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 |
|
kenlok
Starting Member
16 Posts |
Posted - 2009-11-04 : 01:44:19
|
| Hi, How can I write a query to check the CreateDateTime which is from now with-in 1 hours?Thanks(Assumet now is 29/7/2008 11:56)Before-------------------------------------------------Source Subject CreateDateTime CompleteDateTimeA MODIFY 29/7/2008 10:14 NULLA MODIFY 29/7/2008 10:22 NULLA MODIFY 29/7/2008 11:24 NULLA MODIFY 29/7/2008 11:54 NULLAfter ------------------------------------------------Source Subject CreateDateTime CompleteDateTimeA MODIFY 29/7/2008 11:24 NULLA MODIFY 29/7/2008 11:54 NULL |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-11-04 : 03:16:09
|
where date_column between dateadd(hour,-1,getdate()) and getdate() No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-04 : 03:17:38
|
| where date_col>=dateadd(hour,-1,getdate())MadhivananFailing to plan is Planning to fail |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-11-04 : 03:19:11
|
quote: Originally posted by madhivanan where date_col>=dateadd(hour,-1,getdate())MadhivananFailing to plan is Planning to fail
madhi - that's too simple  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-04 : 03:39:18
|
quote: Originally posted by webfred
quote: Originally posted by madhivanan where date_col>=dateadd(hour,-1,getdate())MadhivananFailing to plan is Planning to fail
madhi - that's too simple  No, you're never too old to Yak'n'Roll if you're too young to die.
People always want to have simple solutions MadhivananFailing to plan is Planning to fail |
 |
|
|
kenlok
Starting Member
16 Posts |
Posted - 2009-11-04 : 05:39:32
|
| Woo~~~~~thanks so much!! |
 |
|
|
|
|
|
|
|