Re: query assistance -return most recent date
From: Rich_A2B (RichA2B_at_discussions.microsoft.com)
Date: 02/11/05
- Previous message: Ram Kumar Koditala: "RE: err"
- In reply to: Hugo Kornelis: "Re: query assistance -return most recent date"
- Next in thread: Hugo Kornelis: "Re: query assistance -return most recent date"
- Reply: Hugo Kornelis: "Re: query assistance -return most recent date"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 11 Feb 2005 08:35:07 -0800
That works, thanks! Now to complicate things, I have a third field,
DEL_RECIP_NAME. There can exist records where PKG_NUM is the same, but both
DEL_DATE_TIME and DEL_RECIP_NAME are different. How do I show all three
fields in the query result, but only show records with the most recent
DEL_DATE_TIME?
"Hugo Kornelis" wrote:
> On Thu, 10 Feb 2005 09:17:01 -0800, Rich_A2B wrote:
>
> >I have a table that has two fields, pkg_num, which is a number, and
> >del_date_time, which is a date-time. The table can contain duplicate pkg_num
> >values, as long as the del_date_time values are different for any given
> >number. I need a query that will return the most recent del_date_time for
> >each pkg_num. Any ideas?
>
> Hi Rich_A2B,
>
> Probably
>
> SELECT pkg_num, MAX(del_date_time)
> FROM MyTable
> GROUP BY pkg_num
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>
- Previous message: Ram Kumar Koditala: "RE: err"
- In reply to: Hugo Kornelis: "Re: query assistance -return most recent date"
- Next in thread: Hugo Kornelis: "Re: query assistance -return most recent date"
- Reply: Hugo Kornelis: "Re: query assistance -return most recent date"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|