title: SSRS expression - get date of most recent saturday
body: <p>I am trying to find an SSRS expression that will return the date of the most recent Saturday. If the expression runs on a Saturday, I want it to display the Saturday of the previous week.</p>
  
  <p>I toyed around with an example I found online, and got it to produce the value I need it to produce. Listed below:</p>
  
  <p><code>=IIf(Parameters!O_endDate.Value = nothing, DateAdd("d", -7-(WeekDay(Today(),7))+8, Today()), Parameters!O_endDate.Value)</code></p>
  
  <p>I apologize for the stupid post. I cannot understand why the above expression is producing the value I need, and I want to know if it will continue to work as I want it to work, when run on other days of the week in the future. Note: I ran this code on a Sunday.</p>