Query with multiple criteria

  • Thread starter Thread starter esi
  • Start date Start date
E

esi

I have a table "Orders" with the following fields:

Date Shipped Open Rejected Cancelled
Out of Stock
Sample Data 3/1 40 5 5 6
20

I need to write a query to find any dates where we had 20 or more orders
with 2 different order status

ex. 3/1 had 20 or more orders that were Shipped and Out of Stock

Thanx
 
SELECT Orders.*
FROM Orders
WHERE ((Shipped >= 20) AND ((Open >= 20) OR (Rejected >=20) OR (Cancelled
=20) OR ([Out of Stock] >=20)))
OR ((Open >= 20) AND ((Rejected >=20) OR (Cancelled >=20) OR ([Out of Stock]
OR ((Rejected >= 20) AND ((Cancelled >=20) OR ([Out of Stock] >=20)))
OR ((Cancelled >= 20) AND ([Out of Stock] >= 20))

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top