Results 1 to 3 of 3
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    lookup the most recent date for an entry

    hi All

    i have a dlookup working on a form that run when the form is loaded

    Order_Payment_Date = DLookup("[Entry Date]", "[Account Transactions]", "OrderID=" & "[Forms].[Edit Orders].[OrderID]")

    this finds a entry date from the account transactions table using the orderid from the edit orders form



    this works really well, but what i can't seam to find an answer to is this.

    how can i lookup the most recent date of an entry?

    entry date records dates a payment is made for the order, if there is a payment in the 1st may 2013 and another on the 23rd may 2013, the dlookup does not find the second entry, how can i get dlookup to show the most recent in this case 23rd of may?

    Steve

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Try using Dmax() function for this.

    It has the same syntax as Dloopup()

    DMax(Expr, Domain, Criteria)

    TIP:
    The DMax function ignores Null values in the field referenced by expr. However, if no record satisfies criteria or if domain contains no records, the DMax function returns a Null.

    Dale

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Dale

    Thanks so much, thats exactly what i was after.

    many many thanks

    steve

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

Similar Threads

  1. Choose the row with the MOST RECENT date
    By taimysho0 in forum Queries
    Replies: 1
    Last Post: 05-14-2012, 02:35 PM
  2. Display Most Recent Date
    By jsimard in forum Queries
    Replies: 2
    Last Post: 06-23-2011, 02:44 PM
  3. Get Recent Record without Id or date
    By pyog in forum Queries
    Replies: 5
    Last Post: 04-19-2011, 09:43 AM
  4. Replies: 4
    Last Post: 05-04-2010, 03:33 PM
  5. Return most recent entry for each item
    By GenAp in forum Queries
    Replies: 1
    Last Post: 02-04-2010, 05:30 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