Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set up this Query

Status
Not open for further replies.

fbacchus

IS-IT--Management
May 3, 2001
70
US
Hi All:

I am writing an update query to update some records on my main Acces Table. Basically I want to : "Update FIELDA (in my Main table) with FIELDB (from another Access table) - SET FIELDA to 1 when FIELDB is "Z" OR SET FIELDA to 2 when FIELDB is "Y" OR SET FIELDA to 3 when FIELDB is "W". Any Ideas ?

Frank
Frank M. Bacchus, apc
Informations and Telecommunications Leader
 


Hi Frank

Think this does do what you need - but if you give more details about what you are trying to do a better solution may be found. ie this solution isn't very flexible and isn't very 'access like' - might be better solved by better design.

UPDATE Table1 SET Table1.FieldA = IIf([FieldB]="z",1,IIf([fieldB]="y",2,IIf([fieldb]="w",3,"")));

Stew

PS the is also a access query forum.
 
mymou:

Thanks. Works like a charm.

frank Frank M. Bacchus, apc
Informations and Telecommunications Leader
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top