Filter for Same Value in Two Fields

D

Dave

There are two fields in my query. "From" and "To". For sake of ease, let's
say both these fields are US Cities. How can I pull all the records that show
shipped "From" Denver and that show shipped "To" Denver? Thank you in advance.
 
D

Dave

Just puting Denver in the criteria sections does not work. I need to write an
If statement of some kind (ie- If "From" or "To" = Denver Then show). Or an
Iif statement (Iif ("From" or "To" = Denver, show, hide). How would I do
this? Thanks.
 
J

John W. Vinson

Just puting Denver in the criteria sections does not work. I need to write an
If statement of some kind (ie- If "From" or "To" = Denver Then show). Or an
Iif statement (Iif ("From" or "To" = Denver, show, hide). How would I do
this? Thanks.

Please define "does not work" - in particular open the query in SQL view and
post the SQL here, and indicate what works and what doesn't work. Or, post the
relevant fieldnames of your table (From, To, and the fields that you want to
show, and any other fields to which you're applying criteria).

The OR logic *is the correct solution*, it does work correctly (if done
correctly), it does not require any IF or conditional logic.
 
J

John W. Vinson

Your initial reply did not show up until after my last post. Thank you, the
method you suggested in that post worked.

And it is the method that I suggested in my response as well, which must have
been phrased confusingly... sorry about that, and glad that John Spencer's
good advice worked for you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top