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

help pls.. Expand / Collapse
Author
Message
Posted Monday, December 10, 2012 8:50 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 13, 2014 1:48 PM
Points: 104, 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.


--Pra--------------------------------------------------------------------------------
Post #1394865
Posted Monday, December 10, 2012 9:30 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:23 PM
Points: 20,860, Visits: 32,883
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.


Try the following:


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





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)
Post #1394873
Posted Monday, December 10, 2012 9:36 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 13, 2014 1:48 PM
Points: 104, 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--------------------------------------------------------------------------------
Post #1394875
Posted Monday, December 10, 2012 9:38 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 13, 2014 1:48 PM
Points: 104, Visits: 271
Oops I got it... Have googled it

Thanku so much again


--Pra--------------------------------------------------------------------------------
Post #1394877
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse