473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
3 1454
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: PG | last post by:
When deleting a row from the database, that id is now missing. So what I'm trying to do is update in a loop (maybe an sql loop if there is one) of all of the id numbers - sort of like renaming...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
14
by: Peter Hallett | last post by:
I would like to set up a string array as a class member, or field, and then populate this array by reading in from a text file, but I cannot find the appropriate syntax. The getter and setter are...
1
by: racquetballer | last post by:
I need to to an update query that involves three tables: table Dealer needs to be updated with data from table Personnel and table Title. Dealer is joined to Personnel where Dealer.Dealer_Code =...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.