Results 1 to 2 of 2
  1. #1
    sunil rathore is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    1

    show only newest date for given criteria

    the table having following fields
    1 Account_number
    2 deposit_amount
    3 date_of_deposit


    4 balance_on_deposit

    I want to design query that shows the account_number, newest date of deposit, and balance on the newest date.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    On easy way is to do this in a two-step query:

    Query One
    Create an Aggregate Query to get the latest deposit date for each account_number.
    Do this by creating a new query adding only the "account_number" and "date_of_deposit" fields to it.
    Click on the Totals button to make this an Aggregate Query (button looks like a Sigma).
    On the Totals Row that gets added under each field, change the value of "Group By" under the "date_of_deposit" field to "Max".

    Query Two
    Link Query One back to your original table on account_number and date_of_deposit fields and return those two fields along with the "balance_on_deposit" field.

    Or, if you feel so inclined, you can try nesting these two queries in one query by writing the query in SQL code directly.

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

Similar Threads

  1. how to get data with newest date
    By nubi3 in forum Queries
    Replies: 3
    Last Post: 04-30-2013, 12:14 PM
  2. Newest dates based on criteria
    By benjammin in forum Queries
    Replies: 13
    Last Post: 05-15-2012, 02:49 PM
  3. Replies: 1
    Last Post: 06-12-2011, 07:08 AM
  4. Criteria to show date range
    By Douglasrac in forum Queries
    Replies: 2
    Last Post: 03-24-2011, 03:58 PM
  5. Query From Newest Date
    By SSgtJ in forum Queries
    Replies: 2
    Last Post: 01-21-2010, 01:51 PM

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