multiple ifs, mutliple fields, multiple criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a query with 10 different fields named categ_1 to caetg_10. I
need to know if any of the records in any of the ten fields equal step up or
step up ot? Does anyone have a better way to do this than 20 if statements?
 
The better way would be to normalize your tables. Having repeated fields
like categ_1 to categ_10 is a violation of normalization principles: you
should have 10 rows in a subtable instead.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



jeanne said:
I am creating a query with 10 different fields named categ_1 to caetg_10. I
need to know if any of the records in any of the ten fields equal step up or
step up ot? Does anyone have a better way to do this than 20 if
statements?
 
I am creating a query with 10 different fields named categ_1 to caetg_10. I
need to know if any of the records in any of the ten fields equal step up or
step up ot? Does anyone have a better way to do this than 20 if statements?

Zero IF statements, one query: put

IN ("Step Up", "Step Up OT")

on the Criteria line under each of the ten fields in the query grid,
putting it on a new line in the query grid each time to use OR logic.
You'll have to use the Insert... Rows menu option to get enough rows
in the grid I suspect.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top