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

This is what your actual query is

 SELECT effectiveDate,
        WHEN note="REGULAR LOGGED" THEN log
     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

Browse More Popular Posts

Leave a Comment