Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2010-08-03 : 08:59:49
|
For any current year I need to set up 12 buckets (by each month) with a from date and to date for each month. How can I easily do that? Thank you. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2010-08-03 : 09:15:09
|
SELECT DATEADD(month,spt.number,'20100101') as FromDate,DATEADD(month,spt.number+1,'20100101') as ToDateFROM master..spt_values sptWHERE spt.number < 12 and spt.type = 'P'JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|