Query Criteria

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am trying to create a query where by if a certain
parameter is given if one field a certain critrea is also
to be met in another field
EG
I have a "company name" and if that company name is "ABC"
then "catergory" critera must contain "*FV1*"
if the "company name" is "XYZ" then "catergory" critera
must contain "*FV2*" and id the "company name" is
not "ABC" or "XYZ" then there is no criteria
in "catergory"
Right that should be clear as mud
I hope some one can help me
Regards
David
and Thank you in advance
 
Dear David:

Sounds pretty clear to me. Let's see if I've got it.

Could you not put the combinations into a table:

CompanyName Category
ABC *FV1*
XYZ *FV2*

JOIN this table with your existing data on CompanyName and then say:

FROM ExistingTable T
INNER JOIN NewTable T1 ON T1.CompanyName = T.CompanyName
WHERE T.Category LIKE T1.Category

This should allow you to set up any number of Company / Category
combinations and edit them as a table, not as a hard-wired portion of
a query. It's pretty quick, elegant, and flexible (if I do say so
myself).

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top