Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Last Time Stamp of Matching Job Dates Query
Stanley Mc Keown 
     
11 months ago
I have an items maintenance database with fields for

MaintenanceID,

JobDate,

EntryTimeStamp,( to DB )

  The problem I face is that there maybe several entries under the same JobDate but I only want to use one of those entries to show on a performance report/chart.

  Can I use a query to count only the JobDate records with the last EntryTimeStamp or the largest MaintenanceID number for each JobDate?
Stanley Mc Keown OP  @Reply  
     
11 months ago
Meant to say for each item number too ie a count of maintenance events per month per item but only one of the same JobDates not all the JobDates that are equal.
Sami Shamma  @Reply  
             
11 months ago
watch the folloing video  
DMax
Stanley Mc Keown OP  @Reply  
     
11 months ago
Thanks Sami but its not really the answer I'm trying to find.

If I have two records both with the same item ID and the same job date but with a different time stamp or entry id I want to end up with just one record ie the last one entered with that Jobdate but I also want all the previous jobdates for that same itemID as long as the jobdates are all unique for that item. ie I can't count two jobs where the JobDates are the same. ie one JobDate per item but must be the last one entered.

Hope that makes sense
Stanley Mc Keown OP  @Reply  
     
11 months ago
ie -- The last one of the duplicate JobDates
Stanley Mc Keown OP  @Reply  
     
11 months ago
The video about Last & First shows to use Max and min instead and gets somewhere near the outcome but I'm having difficulty translating it to solve my problem.
Stanley Mc Keown OP  @Reply  
     
11 months ago
I got it -- and it was fairly simple in the end. Just max'ed the time stamp and then included the itemID and the JobDone date.

Note to self
What I need to remember about queries is that any field you ask it to include must be shown so hence I get every JobDate and every ItemID but only the Max time stamp for each.

  Hope this helps anyone else with this problem -- it solves more than one problem for me as I can now base other queries on this principle to extract other data I need.
Sami Shamma  @Reply  
             
11 months ago
Stanley what you have gone through is the best way to learn.
Stanley Mc Keown OP  @Reply  
     
11 months ago
Yes Sami -- my take away from it was that the number of fields you add to any query changes the number of results you get.
  I had other fields I shouldn't have added so they had to be shown in the results so my Max on the aggregate query wasn't giving me the expected results ie it would show other duplicate dates because it needed to show the other fields that were different from the fields on the duplicate date fields hence I got the duplicate dates as well. Cutting those fields out of the query was the answer.
   I twigged it when Richard in his Last & First video mentioned the Max aggregate wouldn't work with all the fields in so he did it with only one field and added the others with a new query.

  Mine was a bit different and I needed to add some other fields that would be the same ie the JobDone date field and the ItemID field otherwise I just got the very last time stamp of the history table. Now I get the very last time stamp of that item and the last JobDate of the item

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/22/2026 1:01:47 AM. PLT: 0s