Generating a range of dates

Download sql-server eBook

Parameters

ParameterDetails
@FromDateThe inclusive lower boundary of the generated date range.
@ToDateThe inclusive upper boundary of the generated date range.

Remarks

Most experts seem to recommend creating a Dates table instead of generating a sequence on the fly. See http://dba.stackexchange.com/questions/86435/filling-in-date-holes-in-grouped-by-date-sql-data

Related Examples

Stats

45 Contributors: 2
Tuesday, September 20, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook