G
Guest
I have a query that sums qty sold by item and by class within a date range.
I want to create a second query that sums the date by month and year. I've
try formatting the date but no luck. My gaol is to get the data in a format
that I can filter on month and year.
Here is the current SQL query.
SELECT DISTINCTROW dbo_OELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbo_OELINHST_SQL.prod_cat, Avg(dbo_OELINHST_SQL.unit_cost) AS AvgOfunit_cost,
Sum(dbo_OELINHST_SQL.qty_to_ship) AS SumOfqty_to_ship
FROM dbo_OELINHST_SQL INNER JOIN dbo_ARCUSFIL_SQL ON dbo_OELINHST_SQL.cus_no
= dbo_ARCUSFIL_SQL.cus_no
WHERE (((dbo_OELINHST_SQL.billed_dt) Between [Enter Start Date:] And [Enter
end Date:] Or (dbo_OELINHST_SQL.billed_dt) Is Null))
GROUP BY dbo_OELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbo_OELINHST_SQL.prod_cat, dbo_OELINHST_SQL.ord_type
HAVING (((dbo_OELINHST_SQL.ord_type)="O"));
I want to create a second query that sums the date by month and year. I've
try formatting the date but no luck. My gaol is to get the data in a format
that I can filter on month and year.
Here is the current SQL query.
SELECT DISTINCTROW dbo_OELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbo_OELINHST_SQL.prod_cat, Avg(dbo_OELINHST_SQL.unit_cost) AS AvgOfunit_cost,
Sum(dbo_OELINHST_SQL.qty_to_ship) AS SumOfqty_to_ship
FROM dbo_OELINHST_SQL INNER JOIN dbo_ARCUSFIL_SQL ON dbo_OELINHST_SQL.cus_no
= dbo_ARCUSFIL_SQL.cus_no
WHERE (((dbo_OELINHST_SQL.billed_dt) Between [Enter Start Date:] And [Enter
end Date:] Or (dbo_OELINHST_SQL.billed_dt) Is Null))
GROUP BY dbo_OELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbo_OELINHST_SQL.prod_cat, dbo_OELINHST_SQL.ord_type
HAVING (((dbo_OELINHST_SQL.ord_type)="O"));