Results 1 to 3 of 3
  1. #1
    gebobs is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    2

    Not First/Last...Oldest/Newest

    Man...my Access foo has gotten rusty. Perhaps someone can help.

    I want to get the oldest and newest inventory items used in a batch. So I made a totals query for which I enter the batch number and for that batch it returns the First and Last create_date. Of course, if the items are not entered into the table chronologically, it doesn't work.



    e.g
    Click image for larger version. 

Name:	Capture.JPG 
Views:	15 
Size:	16.2 KB 
ID:	41268
    ...and there is other older inventory between these two in the table (e.g. 8/7/19).

    I thought, oh easy, I'll just sort. Of course, there's nothing to sort. The query only returns the one record for the batch.

    Sure I'm forgetting something fundamental. How can I get such a query to return the oldest and newest rather than first and last?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    first and last are pretty meaningless without an order - so sorting on date_created should do the trick

    but the usual way would be to use min and max

  3. #3
    gebobs is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    2
    Quote Originally Posted by Ajax View Post
    first and last are pretty meaningless without an order - so sorting on date_created should do the trick

    but the usual way would be to use min and max
    Thank you for helping this old man across the road. Min/max...cripes how did I miss that?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Find the oldest date using a query
    By siema24 in forum Queries
    Replies: 4
    Last Post: 04-19-2017, 09:30 AM
  2. Displaying Oldest and Newest Date in Query
    By spyldbrat in forum Access
    Replies: 2
    Last Post: 07-28-2015, 12:56 PM
  3. find oldest letter in table
    By megatronixs in forum Queries
    Replies: 7
    Last Post: 07-13-2015, 11:49 AM
  4. Replies: 6
    Last Post: 09-07-2014, 11:29 AM
  5. Sort oldest to newest on form
    By Desstro in forum Forms
    Replies: 6
    Last Post: 09-18-2010, 05:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums