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 |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2009-01-29 : 12:09:08
|
| I have a shopping cart table that has a datetime field in it. I want to select all records that do not include the time plus 10 minutes. So if the entry is within that 10 minutes window, I do not want to include it in the records returnedDaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-29 : 12:11:39
|
did you meant this?select * from table where ABS(DATEDIFF(mm,datefield,GETDATE())>10 |
 |
|
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2009-01-29 : 12:16:01
|
| Incorrect syntax near '>'.DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-29 : 12:23:18
|
missed a bracesselect * from table where ABS(DATEDIFF(mm,datefield,GETDATE()))>10 |
 |
|
|
tonymorell10
Yak Posting Veteran
90 Posts |
Posted - 2009-01-29 : 12:39:02
|
Shouldn't that be select * from table where ABS(DATEDIFF(mi,datefield,GETDATE()))>10 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-29 : 12:41:33
|
quote: Originally posted by tonymorell10 Shouldn't that be select * from table where ABS(DATEDIFF(mi,datefield,GETDATE()))>10
ah...yes...nice spot or evenselect * from table where ABS(DATEDIFF(n,datefield,GETDATE()))>10 |
 |
|
|
|
|
|