Skip to main content
1 of 2
crokusek
  • 2.1k
  • 4
  • 24
  • 33

Replace dateadd() with datediff() to get an adequate approximate (30%ish).

 select distinct SessionId from [User].Session     -- 1.2M est, 3.0M act.
  where datediff(day, CreatedUtc, sysutcdatetime()) < 365

This appears to be a bug similar to MS Connect 630583.

Option recompile makes no difference.

enter image description here

crokusek
  • 2.1k
  • 4
  • 24
  • 33