Generate Dates for particular range using SQL server -
i need generate dates particular date range e.g. 2010 2050 googled didn't find solution. how can generate date range using sql server. need using sql query not use stored procedure , block. appreciate.
thanks
create numbers/tally table (a table values 0 10,000, let's say), call dbo.numbers, select there, calculating date each number, starting @ 1 , whatever number need:
select dateadd(day, n.number, '2010-01-01') dbo.numbers n n < [yourmaxnumberhere]
Comments
Post a Comment