title: Error when using DateAdd on a parameter in SSRS
body: <p>I am trying to set a range of dates. I receive a parameter called @EffectiveDate and i want to set a range from 3 years prior to the effective date. </p>
  
  <p>As an example. This is working code. </p>
  
  <pre><code>CStr(Format(CDate(DateAdd(DateInterval.Year, -3, Today())),"yyyy"))
  </code></pre>
  
  <p>But when I try to use the parameter like below</p>
  
  <pre><code>=CStr(Format(DateAdd(DateInterval.Year, -3, CDate(Parameters!EffectiveDate.Value)),"yyyy"))
  </code></pre>
  
  <p>I get an error. I don't know what the error is. All i see is #Error when running the report. </p>
  
  <p>The parameter is set up as "Date/Time" in SSRS and I even convert it just incase. </p>
  
  <p>The following code does work though</p>
  
  <pre><code>=CStr(Format(CDate(Parameters!EffectiveDate.Value),"yyyy"))
  </code></pre>
  
  <p>So it does seem like it is the "DateAdd" method</p>
  
  <p>Any help would be greatly appreciated. Thank you</p>