Get Day Names From Date Range

SQLSoldier Nov 17th, 2015 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Declare @Date1 date = '11/14/2015',
  2.         @Date2 date = '11/17/2015';
  4. With TrackTime (TrackTime)
  5. As (Select @Date1 As TrackTime
  6.     Union All
  7.     Select DateAdd(day, 1, TrackTime) As TrackTime
  8.     From TrackTime
  9.     Where TrackTime < @Date2
  10.     )
  11. Select TT.TrackTime, DateName(dw, TT.TrackTime)
  12. From TrackTime TT;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand