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 |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 11:10:29
|
| How did i select the 1st day of previous month onlyI only want the day number. eg 01, 15MCTS / MCITP certified |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-02-04 : 11:26:46
|
| This doesn't make sense. The first day of the previous month is always 1.JimEveryday I learn something that somebody else already knew |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 11:33:47
|
| lol sorry i have had a few pintsi meant to say.How do you select only the day. from (SELECT DATEADD(month,datediff(month,0,getdate())-1,0))The above shows the first day of the previous month. |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-02-04 : 11:42:14
|
| I'm still guessingSELECT DATENAME(weekday,DATEADD(month,datediff(month,0,getdate())-1,0) )Perhaps you can give an example of the input and what you're expected output is.JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|