I have below query SELECT cl.name, SUM(od.product_price * od.product_quantity / o.conversion_rate) as orderSum, SUM(od.product_quantity) as orderQty, AVG(od.product_price / o.conversion_rate) as priveAvg
FROM orders o
STRAIGHT_JOIN order_detail od ON o.id_order = od.id_order
LEFT JOIN product p ON p.id_product = od.product_id
INNER JOIN product_shop product_shop
ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)
LEFT JOIN category_lang cl ON (product_shop.id_category_default = cl.id_category AND cl.id_lang = 1 AND cl.id_shop = 1 )
WHERE o.valid = 1
AND o.invoice_date BETWEEN ‘2019-08-01 00:00:00’ AND '2019-08-01 23:59:59’
AND o.id_shop IN (1)
GROUP BY product_shop.id_category_default
Here the date ‘2019-08-01 00:00:00’ AND '2019-08-01 23:59:59’ I need to get from the invoice_date table. How I can get this.
date mentioned above you can see static. I need use as variable and should be able to use it in filter. If i select today’s date i should be able to see today’s statistics. If i select yesterday date i should be able to see yesterday’s statistics.