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 - 2012-03-09 : 11:06:33
|
| Hello everyoneI am after a date statementTodays date -1 day and then -1 one second.Regards Rob |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-09 : 11:21:40
|
| DATEADD(dd,-1,DATEADD(ss,-1,GETDATE()))------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2012-03-09 : 11:27:13
|
| what about from today (getdate()) and go back to '07-Mar-2012 23:59:59 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-09 : 11:33:54
|
| apply similar logic itself based on DATEADD------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2012-03-09 : 11:44:47
|
| got itselect dateadd (ss, -1,datediff(dd, +1,getdate())) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-09 : 11:48:20
|
| select dateadd (ss, -1,dateadd(dd, -2,getdate()))------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|