Results 1 to 3 of 3
  1. #1
    tommy93 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    36

    Filter query to show 1 "task" for each job

    Hello,



    Currently i have a database that records jobs for a company. Each job has assigned "Tasks" (ie. call customer, call engineer) which are stored in another table for task history recording. These tasks have 3 fields; Task, Task Date and Task Time.

    What I need is a way of building a query to only show the latest task for each job for their operations. At the moment, searching the tasks shows up all of the tasks for every job, but i need just the latest (or next) task for each job.
    can anyone help?

    Thanks

  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
    Finding the most recent record is a common requirement.

    Review this recent thread https://www.accessforums.net/queries...ble-39197.html on similar issue.
    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
    tommy93 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    36
    Quote Originally Posted by June7 View Post
    Finding the most recent record is a common requirement.

    Review this recent thread https://www.accessforums.net/queries...ble-39197.html on similar issue.
    Hello,

    After reading that it seems that sql only shows the last record. I need the last record for each job. For example;

    These are the jobs. These are the job "tasks".

    from that screen, i can see the next task for job 15 would to be to cancel an engineer on the 16th. (these dates are only dummy data)

    Each job in the database can have several of these tasks assigned. Once one task is complete, a new one is tasked to the job. I need to run a query that will just show the latest task for each job.
    The query at the moment returns all tasks, but i need it to filter to just show 1 for each job ID, which is the next job based on task date and time.

    Thanks
    Last edited by tommy93; 11-08-2013 at 08:59 PM. Reason: typo

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

Similar Threads

  1. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  2. Running a query with an "if/than" filter
    By AudiA4_20T in forum Queries
    Replies: 7
    Last Post: 06-08-2012, 09:36 AM
  3. Query Design to Filter datas "in between"
    By nizam in forum Queries
    Replies: 8
    Last Post: 08-04-2011, 01:26 PM
  4. Replies: 3
    Last Post: 07-23-2011, 09:12 AM
  5. Using ListBox value as "Body of outlook task"
    By AccessFreak in forum Database Design
    Replies: 3
    Last Post: 05-07-2011, 04:40 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