Combining text fields for a report

Hi all,

Back to programming with Base. I am trying to combine the contents of two text fields into one display field. I am doing a report that has a vehicle’s make as a field, and its type as another. Would like to combine the two to get a single displayed field on the report. Tried a lot of things, no success. Any assistance appreciated.

Do it by a query:

SELECT "field1"||', '||"field2" AS "combination" FROM "table"

This will concatenate both fields with comma as separator. You could use also CHAR(13)||CHAR(10) as separator to get a new line.

2 Likes

Sir, thank you. Except for the double quote after the AS, I placed this part:

"field1"||', '||"field2" AS "combination"

into the SQL for the query which produced the report, and used the resulting combination as a field on the report.

To the multiplication of brain cells… thanks again…

And for everyone out there, I recommend this site to help with your SQL…

… saves you time and headache…

For Base also: Base Guide 7.3

… have removed the doubled doublequotes in my first post.