Newbie here. The code below is doing a great job returning the results I want. The only problem is that I can’t figure out how to return only a certain date range (found in checkdate column). The only way I can get it to filter by date of checkdate is to GROUP BY empchecks.checkdate and use HAVING checkdate>=whatever. But I have to GROUP BY employees.enum. I’m sure I’m missing something simple.
SELECT employee_data.a,
employees_data.b, employee_data.c,
GROUP_CONCAT(empchecks.d
ORDER BY empchecks.checkdate
SEPARATOR '<br /> ')
AS checknum,
GROUP_CONCAT(empchecks.checkdate
ORDER BY empchecks.checkdate
SEPARATOR '<br /> ')
AS checkdate,
FROM employees
INNER JOIN empchecks ON employees.enum = empchecks.enum
GROUP BY empchecks.enum
You need to add a WHERE clause. Also a minor correction – that last comma after
AS checkdateshould not be there.