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 |
|
crackerbox
Starting Member
21 Posts |
Posted - 2007-01-22 : 16:37:36
|
| What is the opposite of Select Top? Select Bottom is not valid. I'm trying to get the date closest to another date that is over the first date. I'm getting the closest date, but if I have two dates on the same date, I need the data from the first one it finds and my script is currently pulling the latest one of the day.Any ideas? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-01-22 : 16:44:42
|
| top only returns a consistent row with an order by clauseso the opposite ofselect top .... order by xisselect top .... order by x descmaybe you are looking forselect top 1 *from tblwhere dte > @dteorder by dte==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|