September 17, 2012 at 5:02 am
Hi,
Am using below query to display veh_name, expiration_date,
for new line character, here am using "+CHAR(10)"
what is the new line character, to display the below query.
CREATE VIEW [dbo].[Veh_Market]
AS
SELECT id,
CASE WHEN Veh_Name IS NULL or Veh_Name = '' THEN ''
ELSE CASE WHEN expiration_date IS null then
' Vehicle Name: ' + Veh_Name +CHAR(10)
ELSE ' Vehicle Name: ' +Veh_Name + ' (Expires ' + rtrim(convert(varchar, expiration_date,107)) + ')' +CHAR(10)
END
END
AS summary FROM veh
plz help................
September 17, 2012 at 5:34 am
What are you trying to do exactly?
September 17, 2012 at 6:05 am
Skanda (9/17/2012)
what is the new line character, to display the below query.
Please be clear and specific. If you are new to this forum, its worth looking at best practices to post your queries (check my signature for the link)
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
September 20, 2012 at 11:55 am
actually, char(10) IS the newline character. Maybe you're looking for carriage return? If so, that's char(13)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply