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 |
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-03-28 : 00:32:56
|
| hi team , i need a function that give list of days of a mint like select getdays('1-feb-2012') it returs 1 2 3 4 5 6 7 ... till 29challenge everything |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-28 : 02:54:53
|
[code]select numberfrom master..spt_values vwhere v.type = 'P'and v.number >= 1and v.number <= datepart(day, dateadd(month, datediff(month, 0, '2012-02-01') + 1, -1))[/code]use your own number table if you have one KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-03-28 : 03:24:08
|
| any more suggestions...challenge everything |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-28 : 03:28:38
|
what's wrong with that ?you can use Recursive CTE or while loop if you want KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|