I am working on the date group. at the moment it doesn't return as anything result. I have tried on different filter or group without date, and it fine and working well but I need to create a group based on date or timestamp.
Here is a code
SELECT
settlement_id,
settlement_start_date,
sku AS 'Settlement_sku',
SUM(IF(transaction_type = 'order'
AND amount_description = 'Principal'
AND amount_type = 'ItemPrice',
quantity_purchased,
0)) AS 'total_QTY_Order'
FROM settlements
Where settlement_start_date ='2017-11-12'
GROUP BY sku
HAVING Settlement_sku IS NOT NULL
AND LENGTH(Settlement_sku) > 0
ORDER BY Settlement_sku ASC
as I get a result on
if I remove where settlement_start_date ='2017-11-12'
and change it to Where settlement_id ='7135956892'
and results are working and fine, please see a screenshot
the problem is settlement_start_date is 0000-00-00 so how to get a group without depending on 0000-00-00.
Here is table as you can see three highlights as I want Yellow highlight group with Blue highlight and ignore all red highlight
If you are not sure what I am talking about then maybe I can explain more


