Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

New Line Character Expand / Collapse
Author
Message
Posted Monday, September 17, 2012 5:02 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 8:02 AM
Points: 227, Visits: 703
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................
Post #1360105
Posted Monday, September 17, 2012 5:34 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, June 27, 2014 8:03 AM
Points: 320, Visits: 1,079
What are you trying to do exactly?
Post #1360119
Posted Monday, September 17, 2012 6:05 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
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

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1360135
Posted Thursday, September 20, 2012 11:55 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 28, 2012 6:58 AM
Points: 11, Visits: 51
actually, char(10) IS the newline character. Maybe you're looking for carriage return? If so, that's char(13)
Post #1362206
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse