Gossamer Forum
Home : General : Databases and SQL :

Concat with Line Break

Quote Reply
Concat with Line Break
Hi,

Does anyone know if it's possible to concatenate fields and create line breaks? I am using Links SQL and would like to change the 4 fields that are currently separate fields:

Address
City
State
Zip

I would like to concat them into one field called Full_Address that goes into a text area box so that it looks like:

Address
City, State Zip

So, when I place the <%Full_Address%> tag on a template, then it will display it in the proper format (with the line break after the Address field).

I can put the fields together with:

UPDATE lsql_Links
SET Full_Address = CONCAT (Address, City,', ',State',' ',Zip)

But I don't know how I can get that line break in there after the Address field. I don't want to use the <br> tag because then it shows up and might confuse users when they modify their information. Is there another character that designates a line break that could be used here? Thanks for any help on this.

--Frank
Quote Reply
Re: [FrankM] Concat with Line Break In reply to
O.k. that wasn't so hard. I just figured out that I need to use '\n'

e.g. Concat(Address,'\n',City etc. etc.)

--Frank