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 |
tyekhan
Starting Member
29 Posts |
Posted - 2014-05-22 : 08:17:26
|
i need to change the date, so it will allways select yestoday day,GETDATE() + 1i have the below query for the date,WHERE (History.CallDateTime > CONVERT(DATETIME, '2014-05-21 00:00:00', 102)) |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-05-22 : 08:34:53
|
[code]WHERE CallDateTime >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), -1)AND CallDateTime < DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
adsingh82
Starting Member
20 Posts |
Posted - 2014-05-22 : 09:52:42
|
Please check the correct sqlWHERE CallDateTime >= CONVERT(DATETIME, '2014-05-21 00:00:00', 102) -1AND < CONVERT(DATETIME, '2014-05-21 00:00:00', 102) + 1Regards,Alwyn.M |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-06-17 : 03:05:01
|
quote: Originally posted by adsingh82 Please check the correct sqlWHERE CallDateTime >= CONVERT(DATETIME, '2014-05-21 00:00:00', 102) -1AND < CONVERT(DATETIME, '2014-05-21 00:00:00', 102) + 1Regards,Alwyn.M
khtan's solution is optimal. Do not depend on the date settingsMadhivananFailing to plan is Planning to fail |
|
|
|
|
|
|
|