A
Alberto
Thanks for your responses. Here are the answers to your questions:
grouping [products_quantity] on a weekly basis.
SQL came out. When I went into the SQL to change it to "GROUP BY Week" I got
an error of the following nature:
"You tried to execute a query that does not include the specified expression
'Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd")' as part
of an aggregate function.
I also tried recompiling,
This works fine on the separated query. It is the method by which I'mI can't say much about this. Have you test this alone on the separated query?Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd")
grouping [products_quantity] on a weekly basis.
I created the query in "Design" view within Access and this is the way theShould it be "GROUP BY Week;"?GROUP BY Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd");
SQL came out. When I went into the SQL to change it to "GROUP BY Week" I got
an error of the following nature:
"You tried to execute a query that does not include the specified expression
'Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd")' as part
of an aggregate function.
I also tried recompiling,
AccessVandal via AccessMonster.com said:I can't say much about this. Have you test this alone on the separated query?Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd")
GROUP BY Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd");
Should it be "GROUP BY Week;"?
Is Week reserved in a subroutine or function?
Crystal,
Thanks for all of your help.
Currently, qryNumberOfBuilds looks like this:
Week SumOfproducts_quantity
1/1/07 100
1/8/07 123
1/15/07 130
I need it to look like this:
1/1/07 1/8/07 1/15/07
SumOfproducts_quantity 100 123 130
Here is the underlying SQL.
SELECT Sum(orders_products.products_quantity) AS SumOfproducts_quantity,
Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd") AS Week
FROM orders_status INNER JOIN (((orders INNER JOIN
orders_products_attributes ON
orders.orders_id=orders_products_attributes.orders_id) INNER JOIN
orders_total ON orders.orders_id=orders_total.orders_id) INNER JOIN
orders_products ON
orders_products_attributes.orders_products_id=orders_products.orders_products_id) ON orders_status.orders_status_id=orders.orders_status
WHERE (((orders.invoice_date) Between FromDate() And ToDate()) AND
((orders_products_attributes.products_options_values) Like "*Build*") AND
((orders_products_attributes.products_options) Like "*Build*") AND
((orders_total.class)="ot_total") AND
((orders_status.orders_status_name)="Shipped"))
GROUP BY Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd");