Why do I get an error from this sub query script?

This is what your actual query is

 SELECT effectiveDate,
 CASE
        WHEN note="REGULAR LOGGED" THEN log
      END
     FROM schedules LEFT JOIN timesheet ON schedules.effectiveDate = timesheet.date WHERE schedules.empid='40'
    AND YEAR(effectiveDate) = YEAR(CURDATE()) AND MONTH(effectiveDate) ='1' GROUP BY effectiveDate.

Not sure why you’re using a subquery

Leave a Comment