Parsing data using carriage returns

  • I need to pull data out of a tabel and parse it on carriage returns selecting only the data after the last carriage return.

     

    example

     

    blah blah 1 blah blah (carriage return)

    blah blah 2 blah blah (carriage return)

    blah blah 3 blah blah (carriage return)

    blah blah 4 blah blah (carriage return)

    blah blah 5 blah blah

    I only want it to return the

    blah blah 5 blah blah


    Darrell R. Whalen Jr.

  • SELECT RIGHT(colname,CHARINDEX(CHAR(13),REVERSE(colname))-1)

    FROM

    Far away is close at hand in the images of elsewhere.
    Anon.

  •  

    Okay it is giving me an error that ntext is an improper argument for these functions.  Any idea on how to get around that?


    Darrell R. Whalen Jr.

  • Sorry never mind i used a convert and it works fine.


    Darrell R. Whalen Jr.

  • Okay so how do I give you credit for this?


    Darrell R. Whalen Jr.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply