title: Sql Server Operand type clash: date is incompatible with int
body: <p>When I try to execute this code I get an error at the 'with DateDimension' line:</p>
  
  <blockquote>
    <p>Msg 206, Level 16, State 2, Line 15<br>
    Operand type clash: date is incompatible with int</p>
  </blockquote>
  
  <p>This is the SQL query I am using:</p>
  
  <pre><code>declare @DateCalendarStart  date,
          @DateCalendarEnd    date,
          @FiscalCounter      date,
          @FiscalMonthOffset  int;
  
  set @DateCalendarStart = '2011-01-28';
  set @DateCalendarEnd = '2012-10-26';
  
  
  set @FiscalMonthOffset = 3;
  
  with DateDimension //Error got this line 
  
  as
  
  (
      select  @DateCalendarStart as DateCalendarValue,
              dateadd(m, @FiscalMonthOffset, @DateCalendarStart) as FiscalCounter
  
      union all
  
      select  DateCalendarValue + 1,
              dateadd(m, @FiscalMonthOffset, (DateCalendarValue + 1)) as FiscalCounter
      from    DateDimension 
      where   DateCalendarValue + 1 &lt; = @DateCalendarEnd
  )
  </code></pre>