M
mccloud
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 dbELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbELINHST_SQL.prod_cat, Avg(dbELINHST_SQL.unit_cost) AS AvgOfunit_cost,
Sum(dbELINHST_SQL.qty_to_ship) AS SumOfqty_to_ship
FROM dbELINHST_SQL INNER JOIN dbo_ARCUSFIL_SQL ON dbELINHST_SQL.cus_no
= dbo_ARCUSFIL_SQL.cus_no
WHERE (((dbELINHST_SQL.billed_dt) Between [Enter Start Date:] And [Enter
end Date:] Or (dbELINHST_SQL.billed_dt) Is Null))
GROUP BY dbELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbELINHST_SQL.prod_cat, dbELINHST_SQL.ord_type
HAVING (((dbELINHST_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 dbELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbELINHST_SQL.prod_cat, Avg(dbELINHST_SQL.unit_cost) AS AvgOfunit_cost,
Sum(dbELINHST_SQL.qty_to_ship) AS SumOfqty_to_ship
FROM dbELINHST_SQL INNER JOIN dbo_ARCUSFIL_SQL ON dbELINHST_SQL.cus_no
= dbo_ARCUSFIL_SQL.cus_no
WHERE (((dbELINHST_SQL.billed_dt) Between [Enter Start Date:] And [Enter
end Date:] Or (dbELINHST_SQL.billed_dt) Is Null))
GROUP BY dbELINHST_SQL.item_no, dbo_ARCUSFIL_SQL.cus_type_cd,
dbELINHST_SQL.prod_cat, dbELINHST_SQL.ord_type
HAVING (((dbELINHST_SQL.ord_type)="O"));