我有这个查询,我希望表 mstemp 的所有记录必须根据给定的条件显示。
SELECT
mstEmp.empname, InDate, dailyattendance.InTime,
dailyattendance.OutTime, mstEmp.teamtype
FROM
mstEmp
LEFT JOIN
dailyattendance ON (dailyattendance.HolderName = mstEmp.empname )
WHERE
mstEmp.teamtype = '$chk'
AND (InDate BETWEEN '$from' AND '$to' )
ORDER BY
InDate ASC
但似乎这个查询不起作用。