Want to build a query to return quarterly data

P

Prashant Rao

Table with three columns - Order number, Created, Shipped. Order Number is
repeated because an order may have several line items.

I want to create a query that shows the number of orders that did NOT ship
in the quarter it was created. Please help - I am a light user of access but
I need this for a report this afternoon. Thanks a lot.
 
J

John Spencer

SELECT Distinct [Order Number]
FROM [YourTable]
WHERE Format(Created,"yyyyq") <> Format(Shipped,"yyyyq")

That will show all the order numbers that had a least one shipped date that is
not in the same quarter as the created date.

If you want a count then you can use that query as the source for a totals query.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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