Results 1 to 5 of 5
  1. #1
    Paranap is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    30

    How to sort a list so you only see the latest event


    I have a table of training items and staff will complete these a number of times. What I want to be able to do is just show one of each training item and it to be the latest one.

    Thank you

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Your post may be a little confusing. Often with Employees and Training, you have to consider the Job/Position as well. Often a Job/Position has certain requirements, Employees can be moved into Jobs/Positions and Employees have certain qualifications related to Training.
    See the attached jpg for some ideas.

    Also, you say you only want to
    What I want to be able to do is just show one of each training item and it to be the latest one.
    Do you want to store history records, or just store the latest record?

    Good luck with your project.
    Attached Thumbnails Attached Thumbnails EmployeePositionTraining.jpg  

  3. #3
    Paranap is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    30
    I have a number of tables with info on the staff and then the training sessions they have done and what those training sessions have covered. These records are kept but I want a query to show the latest one so then I can show what training is required and if stuff is out of date.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    How do you know what "stuff is out of date"?
    Can you show us a jpg of your tables and relationships?

    To get the latest (most recent) records you use the TrainingDate along this manner, let's deal with EmployeeX for example:
    Code:
    Select * from Training where 
    EmployeeName ="EmployeeX" and
    TrainingDate = (select Max(TrainingDate) from Training
                            WHERE EmployeeName ="EmployeeX")

  5. #5
    Paranap is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    30
    As you can see I've got a number of tables with all the relevant info on them. Each Training ID corosponds to a training need which has a training interval which is x number of days. So my hope is to have a query to find the latest date for each training ID and then using todays date and the training interval I can work out if something is overdue.
    Attached Thumbnails Attached Thumbnails training.jpg  

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

Similar Threads

  1. Replies: 2
    Last Post: 09-24-2013, 11:38 AM
  2. Does anyone know how to sort the field list?
    By tstoneami in forum Access
    Replies: 4
    Last Post: 08-08-2013, 12:32 PM
  3. Report sort order from list field
    By john3588 in forum Reports
    Replies: 3
    Last Post: 03-01-2013, 02:41 PM
  4. List Box Click Event
    By bginhb in forum Forms
    Replies: 3
    Last Post: 04-09-2012, 02:06 PM
  5. Creating Sort Buttons in a Header in a list view
    By marttaaayyy!! in forum Programming
    Replies: 4
    Last Post: 03-29-2010, 11:08 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