title: How would I use datename in a case statement in SQL
body: <p>How do I use a case statement to determine whether the current date is a saturday, sunday or a weekday?  I have tried the following so any pointers on where I'm going wrong would be appreciated.  Thanks.</p>
  
  <pre><code>SELECT * FROM mytable WHERE day = (SELECT CASE aday
                                          WHEN DATENAME(dw, GETDATE()) = 'Saturday' THEN 'Sat'
                                          WHEN DATENAME(dw, GETDATE()) = 'Sunday' The 'Sun'
                                          ELSE 'Weekday');
  </code></pre>