Bruce Sorge wrote:
> I have this query:
> SELECT IEA_ID, IEA_Name, Address + ' ' + Address2 + ' ' + City + ' ' + Phone
> AS IEAInfo
> FROM tblIEA
> ORDER BY IEA_Name
> 
> This query populates a select list with the IEA name, and when I select an
> item it binds the address info into a textarea. That all works fine. The
> problem I am having is that I want a line break in between the fields so it
> looks like a properly formatted address. How do I do this on the SQL end?
> 

SELECT IEA_ID, IEA_Name, Address + char(13) + char(10) + Address2 + 
char(13) + char(10) + City + char(13) + char(10) + Phone

although, you probably want to use COALESCE also, just in case of NULLs...

SELECT IEA_ID, IEA_Name, COALESCE(Address + char(13) + char(10),'') + 
COALESCE(Address2 + char(13) + char(10),'') + COALESCE(City + char(13) + 
char(10),'') + Phone

and like Neil...I have to say...why?  I'm all for doing things on the 
database side...but formatting isn't generally one of them.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2732
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6

Reply via email to