Posted by GTi on 11/01/05 11:41
David Portas wrote:
> > The table is sorted by timestamp
> That's not correct. Tables are always unsorted.
>
> Try:
>
> SELECT idd
> FROM datetable
> WHERE startdate =
> (SELECT MAX(startdate)
> FROM datetable
> WHERE startdate <= '2005-01-01T02:35:00') ;
>
> --
> David Portas
> SQL Server MVP
> --
David is my hero!
And for my typo:
The correct closest idd (less or equal to 2005/01/01 14:00) is 122223
at 2005/01/01 10:19.
Navigation:
[Reply to this message]
|