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

using an update query to change multible things...need help

P: n/a
I have read in a bunch of files and saved the filename in the table
along with the idnumbers and names.
Thing is they sent us some files that have to be changed now
figures LOL
in the table I have filename field and name field
no problem with an update if filename = "ABC.F" name ="BOB"

but I have 30 of these.
Can a query under criteria and update too.
can this be one on multible criteria and update statements.
if filename = "ABC.Z" name ="BOB"
if filename = "DEF.Z" name ="FRED"

not sure how

thanks for any help

Jerry

Feb 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Probably the quickest way to do this is to use the VBA switch()
function. For example:

UPDATE the_table SET the_table.name =
Switch([filename]="ABC.C","BOB",[filename]="DEF.Z","FRED",True,[filename]);

You may have other criteria you want to add as well but remember to
include the "True,[filename]" criterion at the end as in the example so
those filenames that don't meet any of your criteria are left
unchanged.

HTH,
Bruce

Feb 27 '06 #2

P: n/a
Probably the quickest way to do this is to use the VBA switch()
function. For example:

UPDATE the_table SET the_table.name =
Switch([filename]="ABC.C","BOB",[filename]="DEF.Z","FRED",True,[filename]);

You may have other criteria you want to add as well but remember to
include the "True,[filename]" criterion at the end as in the example so
those filenames that don't meet any of your criteria are left
unchanged.

HTH,
Bruce

Feb 27 '06 #3

P: n/a
that did it thanks big time

Jerry

On 27 Feb 2006 11:00:34 -0800, br***@aristotle.net wrote:
Probably the quickest way to do this is to use the VBA switch()
function. For example:

UPDATE the_table SET the_table.name =
Switch([filename]="ABC.C","BOB",[filename]="DEF.Z","FRED",True,[filename]);

You may have other criteria you want to add as well but remember to
include the "True,[filename]" criterion at the end as in the example so
those filenames that don't meet any of your criteria are left
unchanged.

HTH,
Bruce


Feb 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.