Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


help pls..


help pls..

Author
Message
prathibha_aviator
prathibha_aviator
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 271
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:-):-)--------------------------------------------------------------------------------
Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24217 Visits: 37978
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)




Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
prathibha_aviator
prathibha_aviator
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 271
Awesome I got my output..
But can u explain me ur code...
I haven't come across charindex before... What does it do???

--Pra:-):-)--------------------------------------------------------------------------------
prathibha_aviator
prathibha_aviator
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 271
Oops I got it... Have googled it

Thanku so much again

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


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search