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 |
|
missMac
Posting Yak Master
124 Posts |
Posted - 2009-01-08 : 04:24:57
|
Hello,we are trying to avoid double posts in our application. And dont want to implement it with a disable button.So we are looking to check the last 3 seconds. Here is our codeselect * from illing_Transactions where TransactionDate < DATEADD(s,3,getdate()) and TransactionDate > DATEADD(s,3,getdate()) but nothing is returned |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-01-08 : 04:28:52
|
| select * from illing_Transactions where TransactionDate < DATEADD(s,3,getdate()) and TransactionDate > DATEADD(s,3,getdate())ur query doesnt return anything because ur trying to retrieve on the same condition likeselect * from urtable where col>1 and col<1Jai Krishna |
 |
|
|
missMac
Posting Yak Master
124 Posts |
Posted - 2009-01-08 : 04:37:14
|
| I want to get dates posted greater than the last 3 seconds. Ie a double post will be given plus or minus, error of 3 seconds |
 |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-01-08 : 04:46:52
|
| Hi try thisselect * from illing_Transactions where TransactionDate > DATEADD(s,-3,getdate())Jai Krishna |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2009-01-08 : 04:49:33
|
| Hitry this alsoselect * from illing_Transactionswhere datediff(s,TransactionDate,getdate()) > 3 |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-01-08 : 04:57:41
|
| select * from illing_transactions where transactiondate > dateadd(s,-3,getdate()) and transactiondate < getdate()May Be This Solve your Problem,,Thanks.... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-08 : 08:57:53
|
| [code]select * from illing_Transactions where ABS( datediff(s,TransactionDate,getdate()))<=3[/code] |
 |
|
|
|
|
|
|
|