Results 1 to 3 of 3
  1. #1
    KACJR is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    13

    Query to find most recent donations

    Greetings to the well of knowledge...

    I need some assistance in building a query or programming some VBA logic that will allow me to do the following...

    I have a table of donations made to our organization. There are many instances where the same individual has made multiple donations over time. Shown below is a sample of dummy data...

    IndexedName LastDonationNumeric FormattedDate LastDonationAmount
    ///Fidelity Charitable Gift Fund 41330 02/25/2013 50
    ///Fidelity Charitable Gift Fund 41859 08/08/2014 100
    Aardvark/Aaron// 41748 04/19/2014 100
    Aardvark/Aaron// 41984 12/11/2014 100
    Anteater/Allison// 41752 04/23/2014 5
    Anteater/Allison// 41895 09/13/2014 3
    Badger/Barry// 41700 03/02/2014 145
    Badger/Barry// 41993 12/20/2014 500
    Beaver/Boris// 41270 12/27/2012 200
    Beaver/Boris// 41635 12/27/2013 300
    Beaver/Boris// 41963 11/20/2014 200
    Cumberbatch/Benedict// 41509 08/23/2013 100
    Cumberbatch/Benedict// 41647 01/08/2014 25
    Cumberbatch/Benedict// 41861 08/10/2014 50
    Cumberbatch/Benedict// 41902 09/20/2014 100
    Doe/John// 41638 12/30/2013 50
    Doe/John// 41821 07/01/2014 50
    Doe/John// 41991 12/18/2014 60
    Lincoln/Abraham// 41640 01/01/2014 25
    Lincoln/Abraham// 41760 05/01/2014 25
    Lincoln/Abraham// 41883 09/01/2014 25
    Public/James/Q/ 41289 01/15/2013 200
    Public/James/Q/ 41642 01/03/2014 100
    Public/James/Q/ 41920 10/08/2014 100
    Public/James/Q/ 41988 12/15/2014 100
    Tuna/Charlie// 41637 12/29/2013 100
    Tuna/Charlie// 41891 09/09/2014 125
    Tuna/Charlie// 41987 12/14/2014 50
    Vandersmoot/Linus// 41079 06/19/2012 100
    Vandersmoot/Linus// 41774 05/15/2014 250
    Vandersmoot/Linus// 41911 09/29/2014 150

    What I need to do is find the last donation made by each individual and plant this data into a new table. The last donation date is the "LastDonationNumeric" field (the FormattedDate field is text). So at the end of all this, I need a table that contains...

    IndexedName LastDonationNumeric FormattedDate LastDonationAmount
    ///Fidelity Charitable Gift Fund 41859 08/08/2014 100
    Aardvark/Aaron// 41984 12/11/2014 100
    Anteater/Allison// 41895 09/13/2014 3
    Badger/Barry// 41993 12/20/2014 500
    Beaver/Boris// 41963 11/20/2014 200
    Cumberbatch/Benedict// 41902 09/20/2014 100
    Doe/John// 41991 12/18/2014 60
    Lincoln/Abraham// 41883 09/01/2014 25
    Public/James/Q/ 41988 12/15/2014 100
    Tuna/Charlie// 41987 12/14/2014 50
    Vandersmoot/Linus// 41911 09/29/2014 150

    Any help is greatly appreciated...

    Regards,
    Ken Carter
    TILL, Inc.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Consider TOP N query: http://allenbrowne.com/subquery-01.html#TopN

    Why bother writing to another table? Just use the query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    KACJR is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    13
    Thanks! This was most helpful!

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

Similar Threads

  1. Replies: 1
    Last Post: 02-21-2014, 05:03 PM
  2. Replies: 3
    Last Post: 02-19-2014, 10:21 AM
  3. Find most recent measurement through code
    By todmac in forum Programming
    Replies: 6
    Last Post: 08-09-2013, 04:12 PM
  4. Automatic Monthly Donations
    By hamomianna in forum Access
    Replies: 1
    Last Post: 10-02-2012, 01:17 PM
  5. Most recent data in query
    By LisaEllen in forum Queries
    Replies: 4
    Last Post: 09-14-2011, 09:20 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