By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,881 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

Variable in UPDATE query

P: 1
I have a very simple sql query which at the moment updates a table called 'JackBenny' with a Rating out of 5 stars, the code is:

Expand|Select|Wrap|Line Numbers
  1. UPDATE JackBenny
  2. SET        Rating = 'One Star'
  3. WHERE  ([Episode Number] = '1')
Is there a way to, instead of it updating only if the Episode Number field is 1 as above, so that it can update related to a variable? I am not very good at explaining so I will show you in real life terms what I mean:
Expand|Select|Wrap|Line Numbers
  1. WHERE (Episode Number] = 'SomeVarHere')
So if the 'SomeVarHere' value was "60" the query would run on episode 60.

Nov 21 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.