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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2009-03-28 : 23:25:34
|
| I want to get the closest future duedate record from table mytasksselect taskid from mytasks where finishdate is null and duedate is closest to getdate() where masterrecordid = @MasterIDCan you please help, thanks. |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2009-03-29 : 01:29:01
|
| [code]select top 1 taskid from mytaskswhere finishdate is null and duedate > getdate() and masterrecordid = @MasterIDorder by duedate[/code]CODO ERGO SUM |
 |
|
|
|
|
|