Results 1 to 2 of 2
  1. #1
    tigers is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2006
    Posts
    28

    How would I write this query?

    We have a bunch of clients. For each client there is more than one matter linked to that client. I need to find the matter for each client that has THE MOST time logged against it. I was thinking I should use the Totals functions to do this. I tried using the "MAX" function on the time and the "Last" and "First" functions. I still see the same client with several matters showing in the query results when I use these functions. I need ONE client with the ONE matter that has the most time against it.



    Any ideas??

    Thanks!!

  2. #2
    tigers is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2006
    Posts
    28
    So, I ended up finding something in Access help entitled "Find the record with the top or bottom value within each group". It directed me to drop the matter from the query to select the top values just by the client. I changed the "1" to "all" in the top values and used "max" for the hours. Once I got the result, I relinked the client and the time amount back to the matter. It did create some duplicates but I guess out of 5,500 records that isn't too bad.

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

Similar Threads

  1. Write Conflict Errors with SQL-Access DB
    By trb5016 in forum Access
    Replies: 5
    Last Post: 01-14-2010, 02:10 PM
  2. Write Conflict Error
    By botts121 in forum Access
    Replies: 5
    Last Post: 09-25-2009, 12:11 PM
  3. How to write field values next to each other?
    By Petefured in forum Programming
    Replies: 2
    Last Post: 09-23-2009, 02:39 PM
  4. ADO.Recordset - Write
    By Marvin in forum Programming
    Replies: 0
    Last Post: 07-17-2009, 07:56 AM
  5. write a query how to???
    By flamingo in forum Queries
    Replies: 0
    Last Post: 01-13-2009, 03:57 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