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 |
|
esambath
Yak Posting Veteran
89 Posts |
Posted - 2009-08-10 : 11:27:35
|
| Hi Friends,I need to select the records which are all between the currentdatetimeand the 2 minutes before the currentdatetime.please help me to get the query.Thanks in advance |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-10 : 11:43:28
|
| where date between GETDATE()and dateadd(mi,-2,getdate()) |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-08-10 : 11:45:20
|
| should'nt it be between MIN and MAX? instead of MAX and MIN? |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-08-10 : 11:45:42
|
| [code]where datediff(mi,<urcolumn>,getdate()) <= 2[/code] |
 |
|
|
|
|
|