⌘BABAKOV.NET Let's code!
100% [dark] [ru]
~/posts $

2010-09-07

1 total

Example of Date Range Selection in MSSQL

Example of Date Range Selection: WITH q AS ( SELECT 1 AS num UNION ALL SELECT num + 1 FROM q WHERE num < 10 ) SELECT DATEADD(DAY,0,cast(cast(DATEADD(DAY,-num,SYSDATETIME()) as date) as datetime)) FROM q Simple version of the example of selecting a range of numbers:

19 views 0 comments 0 likes ./Read →