Developer2U
Programmer
I'm trying to figure out if I can somehow use a subquery to provide a solution instead of using two separate queries and then joining them together.
What I'm trying to accomplish is to create a query that returns a count for a specified date range as well as return the fiscal year count for a business area.
I just have a feeling there is a way to do this in one query. I think it would be more efficient because then I would have less objects in the database to maintain. Below are text of both queries, which are working. Thanks in advance.
This is the date range query:
This is the fiscal year query:
What I'm trying to accomplish is to create a query that returns a count for a specified date range as well as return the fiscal year count for a business area.
I just have a feeling there is a way to do this in one query. I think it would be more efficient because then I would have less objects in the database to maintain. Below are text of both queries, which are working. Thanks in advance.
This is the date range query:
Code:
PARAMETERS [Forms]![frmDocumentReviewReports]![cboMonth] Text ( 25 ), [Forms]![frmDocumentReviewReports]![cboYear] Text ( 4 );
SELECT Count(*) AS DescriptionCount, Description
FROM qryDocument_Review_Stats_BusinessArea
WHERE (((Format([Date_Completed],"mmmm"))=[Forms]![frmDocumentReviewReports]![cboMonth]) AND ((Format([Date_Completed],"yyyy"))=[Forms]![frmDocumentReviewReports]![cboYear]))
GROUP BY Description
ORDER BY Description;
This is the fiscal year query:
Code:
PARAMETERS [Forms]![frmDocumentReviewReports]![cboYear] Text ( 25 );
SELECT Description, Count(*) AS FY_Count
FROM qryDocument_Review_Stats_BusinessArea
WHERE (((Date_Completed) Between DateSerial([Forms]![frmDocumentReviewReports]![cboYear]-1,10,1) And DateSerial([Forms]![frmDocumentReviewReports]![cboYear],9,30)))
GROUP BY Description
ORDER BY Description;