help pls..

  • Women Art Revolution (2010)

    "!Next?" (1994)

    "#1 Single" (2006)

    "#ByMySide" (2012)

    "#Follow" (2011)

    "#nitTWITS" (2011)

    "$#*! My Dad Says" (2010)

    "$1,000,000 Chance of a Lifetime" (1986)

    "$100 Makeover" (2010)

    "$100 Taxi Ride" (2001)

    "$100,000 Name That Tune" (1984)

    Above mentioned is the movie column in my table Genres

    I just want to take the year i.e, (YYYY) at the end of each field. I used the code below

    update [Genres] set Movie = SUBSTRING([Movie],0,FINDSTRING ([Movie],"(",1))-1

    And the folllowing error

    Msg 195, Level 15, State 10, Line 1

    'FINDSTRING' is not a recognized built-in function name.

    :crying:

    --Pra:-):-)--------------------------------------------------------------------------------

  • prathibha_aviator (12/10/2012)


    Women Art Revolution (2010)

    "!Next?" (1994)

    "#1 Single" (2006)

    "#ByMySide" (2012)

    "#Follow" (2011)

    "#nitTWITS" (2011)

    "$#*! My Dad Says" (2010)

    "$1,000,000 Chance of a Lifetime" (1986)

    "$100 Makeover" (2010)

    "$100 Taxi Ride" (2001)

    "$100,000 Name That Tune" (1984)

    Above mentioned is the movie column in my table Genres

    I just want to take the year i.e, (YYYY) at the end of each field. I used the code below

    update [Genres] set Movie = SUBSTRING([Movie],0,FINDSTRING ([Movie],"(",1))-1

    And the folllowing error

    Msg 195, Level 15, State 10, Line 1

    'FINDSTRING' is not a recognized built-in function name.

    :crying:

    Try the following:

    update [Genres] set Movie = SUBSTRING([Movie],1,CHARINDEX('(', [Movie]) - 1)

  • Awesome I got my output..

    But can u explain me ur code...

    I haven't come across charindex before... What does it do???

    --Pra:-):-)--------------------------------------------------------------------------------

  • Oops I got it... Have googled it

    Thanku so much again

    --Pra:-):-)--------------------------------------------------------------------------------

Viewing 4 posts - 1 through 3 (of 3 total)

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