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 |
ph1long
Starting Member
16 Posts |
Posted - 2012-12-03 : 12:58:05
|
Hi,Please help. I would like a query that would get me a month prior to today's date and start with day 1. For example,if today's date was 11/23/2012. My end result would be 10/1/2012.Thanks |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-12-03 : 14:21:41
|
[code]DATEADD(mm,DATEDIFF(mm,0,GETDATE())-1,0)[/code] |
|
|
ph1long
Starting Member
16 Posts |
Posted - 2012-12-04 : 10:40:00
|
Thanks. It worked. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|