Results 1 to 3 of 3
  1. #1
    DrDuck is offline Novice
    Windows 7 32bit Access 2000
    Join Date
    Jan 2012
    Posts
    2

    Eliminating redundant records in query results

    I have made a query that takes info from a client table, and lists all of the visits for the past two years. The visit details are stored in a separate table which includes all the visit info for all customers. What I need is to only include the most recent visit for each client. If someone could show an example of an SQL statement that would not return the previous visits for each customer I'd like to try to adapt it myself. I'd appreciate any suggestions that might lead me to a moment of epiphany here.



    Just make up your own fields for the example, I'm just looking for a path to explore to try and figure out the solution.

    Thanks in advance for any advice.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Google: SQL top record each group

    Here's one
    http://www.xaprb.com/blog/2006/12/07...-group-in-sql/
    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
    DrDuck is offline Novice
    Windows 7 32bit Access 2000
    Join Date
    Jan 2012
    Posts
    2

    Thanks

    "Selecting the one maximum row from each group" explained it perfectly... thanks for the pointer June!! Much appreciated.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Replies: 1
    Last Post: 12-08-2011, 01:52 PM
  3. Replies: 1
    Last Post: 03-09-2011, 02:04 AM
  4. Replies: 0
    Last Post: 02-24-2010, 12:56 AM
  5. Replies: 5
    Last Post: 10-08-2009, 05:15 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