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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GOING INSANE: Multiple Replace criteria in Multiple Fields 1

Status
Not open for further replies.

IanGlinka

IS-IT--Management
Feb 28, 2002
215
US
I'm trying to write 1 update query (as opposed to 60) that will look through approx 20 fields of a single table and replace the cell contents according to multiple replace criteria.

If the contents of the cell are 'N' - the cell must be updated to a null value.

If the contents of the cell are 'V' - the cell must be updated to a 'P' value.

If the contents of the cell are 'A' - the cell must be updated to an 'M' value.

I know I can do this if I write three separate update queries per field (one looking for 'N' and updating the value to null, one looking for 'V' and updating the value to 'P', and one looking for 'A' and updating the value to 'M'), but that would result in 60 queries.

Slowly losing my mind...

Ian
 
Take a look at the switch function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Wow... it's not the fastest thing in the world, but it gets the job done!!!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top