Results 1 to 6 of 6
  1. #1
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73

    Show how many times something has been assigned to someone, and who is next on list

    When I started this project, it never occurred to me that THIS is where I would have a problem, but now that I am here, I realize I have no idea how to accomplish this.

    I have a database that is tracking Judge assignments on cases. What I would like to have happen is have a query or report that shows two things, the number of cases assigned to a certain Judge, and which Judge is next up for case assignment, based upon the number of assignments and the date they were assigned.

    I have one table with the Judge's names with their Bar numbers as key, and then another table that references that one for the Judges from a dropdown box and the case information, for example

    Judge Case_Number Defendant Date_Assigned
    Jones 11111 Billy Thompson 1/1/11


    Smith 11112 Craig Ferguson 1/2/11
    Tyler 11113 Matt Borsch 1/3/11
    Jones 11114 Dennis Mitchell 1/4/11

    I really appreciate any help I may receive. Please let me know if you need any more information.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, this should count them:

    SELECT Judge, Count(*) AS HowMany
    FROM TableName
    GROUP BY Judge
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73
    Well, seeing as how my SQL is about as good as my astrophysics, that explains why that didn't come to me. Thanks!

    By adding an additional date sort, it appears I have what I want from a query. This may come to me, but I may as well ask, can I get the first item in the query, the Judge's name, to appear on a report all by itself?

    Thanks again!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You should be able to use

    SELECT TOP 1 ...

    which with the sorting should return the first item. Might return more than one if there's a tie though.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73
    I decided to go with the list and added it to the form. I really appreciate the help! One of these days I need to get a good SQL book. Any suggestions in that arena?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Having gone to the "school of hard knocks", I never read a book. That probably explains the big gaps in my knowledge.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 09-12-2011, 10:15 AM
  2. Replies: 1
    Last Post: 03-02-2010, 05:01 PM
  3. Don't show lookup list options in report
    By dara in forum Reports
    Replies: 1
    Last Post: 02-17-2010, 10:26 PM
  4. Replies: 5
    Last Post: 05-02-2006, 11:25 AM
  5. Lookup or list field: how Do I not show all records
    By scott munkirs in forum Forms
    Replies: 4
    Last Post: 04-13-2006, 12:44 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