rgb192
asked on
top 1 row where datetime is the earliest
top 1 row where datetime is the earliest
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Pateljitu's is better. Wasn't thinking.
pateljitu,
earliest != latest ;)
select top 1 * from sometable
order by datetimecolumn ASC
earliest != latest ;)
select top 1 * from sometable
order by datetimecolumn ASC
ASKER
thanks
something like this
declare dtTarget datetime
set dtTartet = (select min(dtField)from TableA)
select top 1 * from TableA where dtField = dtTarget