Re: Select the most recent date
From: Greg Linwood (g_linwoodQhotmail.com)
Date: 04/26/04
- Next message: vishal subramaniam: "RE: Any good T-SQL quick reference recommended?"
- Previous message: Aaron Bertrand [MVP]: "Re: Select the most recent date"
- In reply to: Donald Pickering: "Select the most recent date"
- Next in thread: Liz: "Re: Select the most recent date"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Apr 2004 15:24:55 +1000
There are a few ways of writing this query, but a simple way is to use a
sub-query to qualify the where predicate.
select *
from yourtable
where datecolumn in (select max(datecolumn) from yourtable)
Regards,
Greg Linwood
SQL Server MVP
"Donald Pickering" <donpick1@hotmail.com> wrote in message
news:108p6lp8bra9i40@corp.supernews.com...
> Running SQL Server 2000 on Windows 2000 server.
>
> I have a table where one field is a date field.
> I want to find the records with the most recent date in them.
> What SELECT command will find the most recent date?
>
>
>
- Next message: vishal subramaniam: "RE: Any good T-SQL quick reference recommended?"
- Previous message: Aaron Bertrand [MVP]: "Re: Select the most recent date"
- In reply to: Donald Pickering: "Select the most recent date"
- Next in thread: Liz: "Re: Select the most recent date"
- Messages sorted by: [ date ] [ thread ]