Re: query assistance -return most recent date

From: Rich_A2B (RichA2B_at_discussions.microsoft.com)
Date: 02/11/05

  • Next message: Hugo Kornelis: "Re: query assistance -return most recent date"
    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)
    >


  • Next message: Hugo Kornelis: "Re: query assistance -return most recent date"

    Relevant Pages

    • Re: Calculating off of Sums in a footer of a report
      ... "David Pilcher" ... >group that data by a third field and query the data by date. ... >Can't get that additional field to calculate off of sums in the footer. ...
      (microsoft.public.access.reports)
    • Re: Yes/No field in combo box
      ... I tried using an Iff statement as an expression for the third field, ... to run the query, the combo box ... In the Row Source query, put this in the 3rd column: ... Steve Schapel, Microsoft Access MVP ...
      (microsoft.public.access.forms)
    • Re: Ascending Sort Problem
      ... Create a query. ... In the first field put the following expression: ... In the second field, put this expression: ... In the third field, put this expression: ...
      (microsoft.public.access.queries)
    • Expression using multiple conditions
      ... multi-conditional expression within a query to compare records in two ... fields in Table2 and if both values match return a value for a third field in ...
      (microsoft.public.access.queries)
    • RE: Access- need to subtract between 2 fields
      ... try this command: ... This will take the first date and subtract it from the second date. ... into either a query or a form. ... "Name of third Field": DateDiff ...
      (microsoft.public.access.gettingstarted)