Most recent date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    Most recent date

    I have a databse tracking container movements. I am happily recording
    each movement and the date of movement and can see where each
    container is by sorting by date of movement. Is there a way I can
    produce a query which would show, for each container, only the most
    recent move
  • Linq Adams via AccessMonster.com

    #2
    Re: Most recent date

    In Design View for the query, select View - SQL and paste this in,
    substituting
    your actual object names for ContainerID , MovementDate and
    ContainerTracki ngTable

    SELECT ContainerID AS Expr1, Max(Movementdat e) AS max_date
    FROM ContainerTracki ngTable
    GROUP BY ContainerID;

    --
    There's ALWAYS more than one way to skin a cat!

    Answers/posts based on Access 2000/2003

    Message posted via AccessMonster.c om


    Comment

    • Steve

      #3
      Re: Most recent date

      On May 17, 10:56 pm, "Linq Adams via AccessMonster.c om" <u28780@uwe>
      wrote:
      In Design View for the query, select View - SQL and paste this in,
      substituting
      your actual object names for ContainerID , MovementDate and
      ContainerTracki ngTable
      >
      SELECT ContainerID AS Expr1, Max(Movementdat e) AS max_date
      FROM ContainerTracki ngTable
      GROUP BY ContainerID;
      >
      --
      There's ALWAYS more than one way to skin a cat!
      >
      Answers/posts based on Access 2000/2003
      >
      Message posted via AccessMonster.c omhttp://www.accessmonst er.com/Uwe/Forums.aspx/databases-ms-access/2008...
      Thank you - works like a charm

      Comment

      • Linq Adams via AccessMonster.com

        #4
        Re: Most recent date

        Glad to help!

        Steve wrote:
        >On May 17, 10:56 pm, "Linq Adams via AccessMonster.c om" <u28780@uwe>
        >wrote:
        >In Design View for the query, select View - SQL and paste this in,
        >substituting
        >[quoted text clipped - 11 lines]
        >>
        >Message posted via AccessMonster.c omhttp://www.accessmonst er.com/Uwe/Forums.aspx/databases-ms-access/2008...
        >
        >Thank you - works like a charm
        --
        There's ALWAYS more than one way to skin a cat!

        Answers/posts based on Access 2000/2003

        Message posted via http://www.accessmonster.com

        Comment

        Working...