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 |
jrobin747
Starting Member
48 Posts |
Posted - 2013-08-23 : 10:34:48
|
I'm trying to understand the logic of days in SQLIf today, I wanted to get a count for a day, to accurately do thatwould my date range be yesterdays date and tomorrows date. |
|
MuMu88
Aged Yak Warrior
549 Posts |
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2013-08-23 : 11:05:23
|
[code]WHERE YourDate >= DATEADD(d, DATEDIFF(d, 0, CURRENT_TIMESTAMP), 0) -- today at 00:00:00 AND YourDate < DATEADD(d, DATEDIFF(d, 0, CURRENT_TIMESTAMP), 1) -- tomorrow at 00:00:00[/code] |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|