DaveyCrockett
Programmer
Hello All,
I was hoping for a little knowledge on how to group multiple values together. I have a query that links multiple tables, queries, etc... and Counts multiple Serial Numbers. It groups them by the month, but I also somehow need to group them by year. As I am trying retrieve 12 months of data, count the serial number, group them by the actual month to produce a revolving report.
The revolving report will show 3 calculated values for each month starting with current month and back 11.
Does this make sense? I hope so. I am new to access and have been dropped in performing maintenance and a little modifications are required. I have searched for ways to do this, but have come up empty handed. If anyone knows any good examples and websites that will help me with this it would be greatly appreciated.
Below is the SQL from the current query:
SELECT tblProduct.Product AS [Equipment Type], Count(qryRollingMonthlySrc.WOH_ORDERNUM) AS [Total Service Request], Sum([WOH_LPRICE]+[WOH_EXPPRICE]+[WOH_TRAVPRICE]+[WOH_FLATCHRG]+[WOH_PPRICE])/Count([WOH_ORDERNUM]) AS [Average Cost], Sum([WOH_LPRICE]+[WOH_EXPPRICE]+[WOH_TRAVPRICE]+[WOH_FLATCHRG]+[WOH_PPRICE]) AS Billing, Month([WOH_COMDATE]) AS [Month], Year([WOH_COMDATE]) AS Expr1
FROM tblBusinessUnit INNER JOIN (tblProduct INNER JOIN qryRollingMonthlySrc ON tblProduct.WOH_MODELNUM = qryRollingMonthlySrc.WOH_MODELNUM) ON tblBusinessUnit.Business_Unit_ID = qryRollingMonthlySrc.WOH_CUST_DATA2
GROUP BY tblProduct.Product, Month([WOH_COMDATE]), Year([WOH_COMDATE])
ORDER BY Month([WOH_COMDATE]);
Any assistance would be greatly appreciated.
Thank you all in advance for taking the time to review my question.
I was hoping for a little knowledge on how to group multiple values together. I have a query that links multiple tables, queries, etc... and Counts multiple Serial Numbers. It groups them by the month, but I also somehow need to group them by year. As I am trying retrieve 12 months of data, count the serial number, group them by the actual month to produce a revolving report.
The revolving report will show 3 calculated values for each month starting with current month and back 11.
Does this make sense? I hope so. I am new to access and have been dropped in performing maintenance and a little modifications are required. I have searched for ways to do this, but have come up empty handed. If anyone knows any good examples and websites that will help me with this it would be greatly appreciated.
Below is the SQL from the current query:
SELECT tblProduct.Product AS [Equipment Type], Count(qryRollingMonthlySrc.WOH_ORDERNUM) AS [Total Service Request], Sum([WOH_LPRICE]+[WOH_EXPPRICE]+[WOH_TRAVPRICE]+[WOH_FLATCHRG]+[WOH_PPRICE])/Count([WOH_ORDERNUM]) AS [Average Cost], Sum([WOH_LPRICE]+[WOH_EXPPRICE]+[WOH_TRAVPRICE]+[WOH_FLATCHRG]+[WOH_PPRICE]) AS Billing, Month([WOH_COMDATE]) AS [Month], Year([WOH_COMDATE]) AS Expr1
FROM tblBusinessUnit INNER JOIN (tblProduct INNER JOIN qryRollingMonthlySrc ON tblProduct.WOH_MODELNUM = qryRollingMonthlySrc.WOH_MODELNUM) ON tblBusinessUnit.Business_Unit_ID = qryRollingMonthlySrc.WOH_CUST_DATA2
GROUP BY tblProduct.Product, Month([WOH_COMDATE]), Year([WOH_COMDATE])
ORDER BY Month([WOH_COMDATE]);
Any assistance would be greatly appreciated.
Thank you all in advance for taking the time to review my question.