title: TSQL Check if date of work completion is less than today
body: <p>In a employee task application i have to find if the employee has finished the task on time or he is working overtime so i put together this to find it's not working</p>
  <pre><code>SELECT case when (CAST('2011-1-1' as datetime) &lt; cast('2011-1-2' as datetime)) THEN 'Finished' ELSE 'UnFinished' end
  </code></pre>
  <p>well the dates are hardcoded here because i wanted to test the logic first before going on.</p>
  <h3>Edit</h3>
  <p>Sorry i missed the select before the select statement hence the error</p>
  <p><code>Incorrect syntax near the keyword 'case'</code>.</p>
  <p>But now i want to know if there are more efficient ways to do above taking into account that compared fields are <strong>datetime</strong></p>