mysql query with date range does not produce correct result.
help!
here is the query:
select * from table
where
BETWEEN table.sDate AND table.eDate;
is this correct? i tried in mySQL, it runs, but through php, it created duplicate output...here is the actual query from php code:
$query = "select e.empID, e.empFname, e.empLname, d.depID,
d.depName, DATE_FORMAT(s.sDate,\"%b-%d-%Y\") as sDate,
DATE_FORMAT(s.eDate,\"%b-%d-%Y\") as eDate,
s.sTime, s.eTime, s.sFlag, s.contactInfo
from employee as e, status as s, department as d
where e.empID = s.empID
AND d.depID >= s.depID
BETWEEN s.sDate >= '".$startDate."' AND s.eDate <= '".$endDate."'
ORDER by e.empLname";