title: How to find last weekday of current month using SQL
body: <p>How would I calculate the last weekday of the current month given a date using SQL?  </p>
  
  <p>I was able to get the last day of current month, but not sure how to do the last weekday programmatically.</p>
  
  <p>I don't want to generate a calendar look-up table.  </p>
  
  <p>Here's the last day of month code i'm currently using:</p>
  
  <pre><code>declare @date datetime
  set @date='1/4/13'
  select DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, @date) + 1, 0))
  </code></pre>