October 29, 2002 at 9:46 am
I need to insert a field1 + Return Carrage + field2 into a field.
How do I code the Return Carrage please?
October 29, 2002 at 9:58 am
What about field1 + char(10) + field2 ?
October 29, 2002 at 10:08 am
Or chr(13). I use Allen's suggestion. If you need the normal DOS end of line, use mine.
Steve Jones
October 29, 2002 at 10:11 am
Thanks chaps for an instant result. Problem solved
November 1, 2002 at 3:20 pm
Or both for a carriage return line feed (needed for notepad in NT)
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
November 4, 2002 at 8:17 am
simonsabin is correct. You should always use both characters.
IsNull(field1, '') + char(13) + char(10) + IsNull(field2, '').
I also tend to include an IsNull to ensure I get field1 or field2 if either one is null.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply