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 
Access 2003 Query Logic / Buiding
Jeremiah 

17 years ago
Hi, I'm working in an access 2003 database, I have a list of data in a table with names, dates, and start times, and end times for example:

Date     Name  StartTime  EndTime
12/01/09 Name1 1:00:00 PM 2:13:00 PM
12/01/09 Name1 2:00:00 PM 2:15:00 PM
12/01/09 Name2 9:36:00 AM 9:53:00 AM

What I need to build is a query or queries to find all the same names and dates that have times frames that fall within other time frames for that same name and date.
I know that sounds confusing, that's why I'm so stumped.  Say you had a person who had a time frame between 1:00 PM and 2:00 PM, and then that same person had another entry for the same day from 1:30 PM to 3:00 PM, then you can see that start time falls between the start and end time of the first time frame, and that's what I need to find.
Basically it's to see if something was entered within the same time frame as something else, because there shouldn't be any overlapping time frames, so I need to query those out to correct them.

If you could help me that would be great.

Thank you
Jeremiah



Answer from Richard Rost:

You could try a DCOUNT function as a calculated field for each of these entries.

Pull this data into a query. Create a new calculated field like this:

Overlap: DCOUNT("ID","MyTable","Name='" & NameField & "' AND StartTime >= #" & StartTime & "# AND EndTime <= #" & EndTIme & "#")

Now that should give you another field that will count up all instances of other records from this table that meet those criteria. This query won't run super-fast, but it should give you what you're looking for.

Here's a tutorial to help you with DCOUNT:

http://599cd.com/tips/access/dcount/?key=BlFAlEx

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 9:53:49 AM. PLT: 0s