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 
Time criteria in Query
David Cobb 
    
3 years ago
I have attempted to use time (HH:MM:SS) in my query and have not been able to utilize it well. for example instead of just Between Date()-1 and Date() I wanted to do Between Date()-1 05:00 am AND Date() 02:00 am, I have viewed a lot for Date but not much on time and would like a greater understanding of time in queries. I have tried throwing # in a bunch of diffrent ways and even splitting time away or h: Hour([datetime]) in the field.
Kevin Robertson  @Reply  
          
3 years ago
Add this to the criteria of your DateTime field in your query:
Between Date()+(5/24)-1 And Date()+(2/24)

This is saying between yesterday at 5am and today at 2am.

Date Math
Dan Jackson  @Reply  
            
3 years ago
Bear in mind "M" means month. Use N for minutes, so HH:NN:SS
Kevin Robertson  @Reply  
          
3 years ago
Dan Don't know if you've done anything with .NET - with format strings case matters (confusing when going between Access and .NET)

"m" is used for minute.
"M" is used for month.
Dan Jackson  @Reply  
            
3 years ago
So queries use .net?
Kevin Robertson  @Reply  
          
3 years ago
No. just a comment about the difference in custom format codes.
To confuse the issue even further, Excel uses "m" for both minutes and month.
Dan Jackson  @Reply  
            
3 years ago
Joy of joys!
David Cobb OP  @Reply  
    
3 years ago
That is awesome Kevin, thank you.  so time in query is X/24?  I was trying to use 0X:00 am format.

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/1/2026 10:31:44 PM. PLT: 1s