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

Hi, I have a query with a number o

Status
Not open for further replies.

nike2000

Technical User
Apr 1, 2003
61
GB
Hi,
I have a query with a number of fields but would like to filter on the following two fields:

Location1 and Location2

The records in both of these fields will only have the following data:

London, New York, Tokyo, Hong Kong and can also be Null.

I would like to be able to show in the query only the records that have London in either of the two fields.
I have tried it as a Select Query but because the same record can have two different locations placing London in both will only return records with London in both fields.

How can this be written in an IF Statement.

Thanks for your help
Nike
 
Hi

You are on the right track with a query, but instead of using AND use OR

If you are doing this in the query builder grid, just put the criteria on the next line down - criteria on teh same line are treated as an AND, thos on subsequent lines are treated as an OR

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
thanks for gettin back to me raye.
what you have said is fine but Location 1 and Location 2 are completely seperate fields.
they are not together.
i would like to see only those records that have London in either of the two fields.
Nike
 
Hi

yes - so you where clause looks like so

SELECT ..etc.. WHERE Location1 = "London" OR Locations2 = "London"

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top