Evaluate how many orders where open on specific day

Ok, so here is my solution.
The question I had was;
How can I visualize, show or see how many orders, records or posts where open (i.e. not finished or closed) on a specific date?

I began with 2 tables;
1. tblDates
This table contains only the dates I want to evaluate, in my case all dates for the year 2013

2. tblOrders
This table contains OrderID, DateOrderMade, DateOrderAnswerd

I created the first query that uses Pauls "Overlapping Records" templete found here >http : // www . baldyweb . com / OverLap . htm

Code:
SELECT tblDates.ReportDate, tblOrders.OrderID AS OpenOnDateOrderID
FROM tblDates, tblOrders
WHERE (((tblOrders.DateorderMade)<=[ReportDate]) AND ((tblOrders.DateOrderAnswerd)>=[ReportDate] Or (tblOrders.DateOrderAnswerd) Is Null));

Then with a second query I just Total-queried the ReportDates.
Everything can be seen in my attached .zipfile

Code:
SELECT tblDates.ReportDate, Count(OpenOnDate.ReportDate) AS CountOpenOrders
FROM OpenOnDate RIGHT JOIN tblDates ON OpenOnDate.ReportDate = tblDates.ReportDate
GROUP BY tblDates.ReportDate, OpenOnDate.ReportDate;


All credits goes out to the forum members who helped me out.
Im a novice, so there are absolutely things that can be tweaked here, but now this is at least searchable on the internets.

// Kaherdin
Access 2010
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom