Query with multiple criteria

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
 
J

John Viescas

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)
 

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