Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
help pls..
help pls..
Rate Topic
Display Mode
Topic Options
Author
Message
prathibha_aviator
prathibha_aviator
Posted Monday, December 10, 2012 8:50 PM
SSC Journeyman
Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 95,
Visits: 223
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
Lynn Pettis
Lynn Pettis
Posted Monday, December 10, 2012 9:30 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 21,602,
Visits: 27,425
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
prathibha_aviator
prathibha_aviator
Posted Monday, December 10, 2012 9:36 PM
SSC Journeyman
Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 95,
Visits: 223
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
prathibha_aviator
prathibha_aviator
Posted Monday, December 10, 2012 9:38 PM
SSC Journeyman
Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 95,
Visits: 223
Oops I got it... Have googled it
Thanku so much again
--Pra
--------------------------------------------------------------------------------
Post #1394877
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.