I have a form to view data summaries. Using controls, where the user inputs 'from' and 'to' dates, a query is generated to retrieve data and display it on a subform in datasheet view.
The table I'm retrieving data from looks like this:
Receivement(ReceivementID(PK,autoinc nr), ReceivedDate(date), CaseClosed(bool)....)
What I want to see is 3 columns: 1 - month, 2 - number of records, 3 - number of records where CaseClosed is true.
I need a query that retrieves the data like this, but I don't really know how to do it.
What I have managed so far:
This shows the number of records per month, but I fail when I want to add a third column that shows the number of records where CaseClosed is true.
It almost seems like the 3rd column should be a seperate query, but I don't know how I can correctly combine 2 queries to get what I need.
Any suggestions?
The table I'm retrieving data from looks like this:
Receivement(ReceivementID(PK,autoinc nr), ReceivedDate(date), CaseClosed(bool)....)
What I want to see is 3 columns: 1 - month, 2 - number of records, 3 - number of records where CaseClosed is true.
I need a query that retrieves the data like this, but I don't really know how to do it.
What I have managed so far:
Code:
SELECT Count(Receivements_Query.ReceivementID) AS CountOfReceivementID, Format([ReceivedDate],"mmm") AS Month
FROM Receivements_Query
GROUP BY Receivements_Query.CaseClosed, Format([ReceivedDate],"mmm"), Month([ReceivedDate])
HAVING (((Receivements_Query.CaseClosed)=False))
ORDER BY Month([ReceivedDate]);
This shows the number of records per month, but I fail when I want to add a third column that shows the number of records where CaseClosed is true.
It almost seems like the 3rd column should be a seperate query, but I don't know how I can correctly combine 2 queries to get what I need.
Any suggestions?