title: CTE Error : Types don't match between the anchor and the recursive part
body: <p>Execute Following query :</p>
  
  <pre><code>WITH cte AS (
      SELECT CAST('" + mindate+ "' as varchar(255))  as fdate
      UNION ALL
      SELECT CAST(DATEADD(day, 1, fdate) as date)
      FROM cte
      WHERE fdate &lt; '" + tday+"'
  )
  SELECT COUNT(fdate) AS Fdate
  FROM cte left join tbl_Attendence on cte.fdate = tbl_Attendence.Datess
  where tbl_Attendence.Datess is null
  </code></pre>
  
  <p>But I am ending with the following error:</p>
  
  <blockquote>
    <p>Types don't match between the anchor and the recursive part in column
    "fdate" of recursive query "cte".</p>
  </blockquote>