AND OR problem?

AN60

Registered User.
Local time
Today, 21:36
Joined
Oct 25, 2003
Messages
283
I have been using the following;
WHERE (((Lot.Date) Between [Forms]![purchase petroleum by date]![txtFrom] And [Forms]![purchase petroleum by date]![txtTo]) AND ((Lot.Event)="purchase - fuel")) OR (((Lot.Event)="purchase - oil"));

It will work if I leave the OR out but not with it. Any ideas?
 
You can use either:-

WHERE Lot.Date Between [Forms]![purchase petroleum by date]![txtFrom] And [Forms]![purchase petroleum by date]![txtTo] AND (Lot.Event="purchase - fuel" OR Lot.Event="purchase - oil");

or:-

WHERE Lot.Date Between [Forms]![purchase petroleum by date]![txtFrom] And [Forms]![purchase petroleum by date]![txtTo] AND Lot.Event in ("purchase - fuel","purchase - oil");
 
Jon K
I used your suggestion B and everything seems to be working well. Thank you very much. :cool:
 

Users who are viewing this thread

Back
Top Bottom