I want to filter some items based on two different dates using MySQL. In my database I store data like 2017-03-28 10:55:10. But I need only the date part, not the time so I used the DATE() function:
select sum(cashamount) as sumcashsalesamount, DATE(transactiondate) as datepart from master_transaction where transactiondate BETWEEN '2017-02-22%' AND '2017-03-28%' order by transactiondate desc Above this query have two dates 2017-02-22% and 2017-03-28% but this return no result.
But when I change this 2017-03-28% date to 2017-03-29% (tomorrow date) I get results.