Why when I run the query below, it returns records:
SELECT COUNT(DISTINCT(dadf332.numped)) AS qtdped,
DATE_FORMAT(dadf331.datlan, '%d/%m/%Y') AS datavenda
FROM dadf331, dadf332
WHERE dadf331.numped = dadf332.numped
AND tipped = 0
AND dadf331.datlan >= '2018-04-01'
AND dadf331.datlan <= '2018-04-03'
qtdped datavenda
------ ------------
24 02/04/2018
It returns a record on day 02, but if I run the query until day 02, it does not return anything?
SELECT COUNT(DISTINCT(dadf332.numped)) AS qtdped,
DATE_FORMAT(dadf331.datlan, '%d/%m/%Y') AS datavenda
FROM dadf331, dadf332
WHERE dadf331.numped = dadf332.numped
AND tipped = 0
AND dadf331.datlan >= '2018-04-01'
AND dadf331.datlan <= '2018-04-02'
qtdped datavenda
------ -----------
0 (NULL)