New Line Character

  • 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................

  • What are you trying to do exactly?

  • 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[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • 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