kenkomuri Posted August 5, 2013 Share Posted August 5, 2013 Hi, I would like to know if someone has a query to export the sales at level item-attributte of the orders that are shipped (4) or delivered (5) between two dates. I have checked that the dates column are datetime and it makes the process harder. I have the following statement without the date range and does not work select ord.product_reference Reference, ord.product_name Name, sum(ord.product_quantity) Quantity from pr_order_detail ord, pr_orders or where or.id_order = ord.id_order and or.current_state in (4,5) and or.date_add between ("first day and last day of the month" how to do that?) I will appreciate your help. Thanks. Fernando Link to comment Share on other sites More sharing options...
kenkomuri Posted October 16, 2013 Author Share Posted October 16, 2013 No news about it? Link to comment Share on other sites More sharing options...
tuk66 Posted October 17, 2013 Share Posted October 17, 2013 or is a keyword. Try select ord.product_reference Reference, ord.product_name Name, sum(ord.product_quantity) Quantityfrom pr_order_detail ord, pr_orders owhere o.id_order = ord.id_orderand o.current_state in (4,5)and o.date_add between '2013-01-01' and '2013-12-31' Link to comment Share on other sites More sharing options...
kenkomuri Posted October 17, 2013 Author Share Posted October 17, 2013 or is a keyword. Try select ord.product_reference Reference, ord.product_name Name, sum(ord.product_quantity) Quantity from pr_order_detail ord, pr_orders o where o.id_order = ord.id_order and o.current_state in (4,5) and o.date_add between '2013-01-01' and '2013-12-31' Thanks but it seems not to work because shows one result without any sense. Link to comment Share on other sites More sharing options...
Recommended Posts