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 |
|
dimitri24
Starting Member
8 Posts |
Posted - 2003-02-19 : 16:15:50
|
| I have a number of entries in database with a sertain date and time.I need to retrieve all the data with a time between now and (now + 30 minutes).help! |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-02-19 : 16:21:35
|
| SELECT * FROM myTableWHERE dateCol BETWEEN getdate() and DateAdd(minute, 30, getdate()) |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-02-19 : 16:23:23
|
| From Right Now + 30 Minutes? Can you forsee future transactions? Do you Mean - 30 minutes?Anyway, look in BOL For DateAdd functionFor what you asked for, it would be:WHERE date_col between GetDate() AND DateAdd(mi,30,GetDate())Hope this helpsBrett8-) |
 |
|
|
dimitri24
Starting Member
8 Posts |
Posted - 2003-02-19 : 16:25:41
|
quote: SELECT * FROM myTableWHERE dateCol BETWEEN getdate() and DateAdd(minute, 30, getdate())
THANKS |
 |
|
|
|
|
|