Hi all,
I have created a query for totals by year, and another for totals by month (and able to select the month in question)
Is it possible to create a query which combines both, i.e., yearly totals, and including the months? (potentially being able to select the month in question)
See image.
My coding for the yearly totals:
TRANSFORM Count(tempQryTA.TheMonth) AS CountOfTheMonth
SELECT tempQryTA.Test, Count(tempQryTA.TheMonth) AS Total
FROM tempQryTA
GROUP BY tempQryTA.Test
PIVOT tempQryTA.Year;
SELECT Format$([DateReport],'yyyy',0,0) AS [Year], TestsAvailable.Test, Format$([DateReport],'yyyy/mm',0,0) AS TheMonth
FROM TestsAvailable RIGHT JOIN (((Companies INNER JOIN Orders ON (Companies.Company_ID = Orders.Company_ID) AND (Companies.Company_ID = Orders.Company_ID)) LEFT JOIN Samples_List ON Orders.Order_ID = Samples_List.Order_ID) LEFT JOIN SampleTestedFor ON Samples_List.Sample_ID = SampleTestedFor.Sample_ID) ON TestsAvailable.Test_ID = SampleTestedFor.TestedFor
WHERE (((Format$([DateReport],'yyyy',0,0))<>'') AND ((Orders.Order_received)>='2021-05-06' And (Orders.Order_received)<='2023-07-05'));
I suspect that it may not be possible, but I am not an advanced programmer!
Thanks for your input
Harris
I have created a query for totals by year, and another for totals by month (and able to select the month in question)
Is it possible to create a query which combines both, i.e., yearly totals, and including the months? (potentially being able to select the month in question)
See image.
My coding for the yearly totals:
TRANSFORM Count(tempQryTA.TheMonth) AS CountOfTheMonth
SELECT tempQryTA.Test, Count(tempQryTA.TheMonth) AS Total
FROM tempQryTA
GROUP BY tempQryTA.Test
PIVOT tempQryTA.Year;
SELECT Format$([DateReport],'yyyy',0,0) AS [Year], TestsAvailable.Test, Format$([DateReport],'yyyy/mm',0,0) AS TheMonth
FROM TestsAvailable RIGHT JOIN (((Companies INNER JOIN Orders ON (Companies.Company_ID = Orders.Company_ID) AND (Companies.Company_ID = Orders.Company_ID)) LEFT JOIN Samples_List ON Orders.Order_ID = Samples_List.Order_ID) LEFT JOIN SampleTestedFor ON Samples_List.Sample_ID = SampleTestedFor.Sample_ID) ON TestsAvailable.Test_ID = SampleTestedFor.TestedFor
WHERE (((Format$([DateReport],'yyyy',0,0))<>'') AND ((Orders.Order_received)>='2021-05-06' And (Orders.Order_received)<='2023-07-05'));
I suspect that it may not be possible, but I am not an advanced programmer!
Thanks for your input
Harris