title: pertaining to my script, why i cant used where clause to the subquery counter = '1'
body: <p>I have question pertaining to my script, why i cant used where clause to the subquery ( where counter = '1')</p>
  
  <p>I have one sample here please open the picture <a href="https://i.stack.imgur.com/EdMzX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EdMzX.png" alt="sample screen to my script"></a></p>
  
  <pre><code>SELECT effectiveDate,
  
  
    (SELECT
  
    (CASE
      WHEN note='REGULAR LOGGED'
      THEN log
      WHEN description = description
      THEN description
    END)
  
    FROM timesheet WHERE counter ='1'
  
    ) as Counter1
  
  
  FROM  schedules t1 LEFT JOIN timesheet t2 ON t1.empid = t2.empid AND t1.effectiveDate = t2.date
                     LEFT JOIN holidays t3 ON t1.effectiveDate = t3.date WHERE t1.empid ='40'
                     AND YEAR(t1.effectiveDate) = YEAR(CURDATE()) AND MONTH(t1.effectiveDate) = '1' GROUP BY t1.effectiveDate
  </code></pre>