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 
Using and in DCOUNT
Kim 
    
12 years ago
This is my SQL im working around for a report:

SELECT "4:30 TO 6:29" AS TimeCalc, Count(*) AS TotalCalls
FROM Msys_obj AS Q
WHERE Q.Time >=#4:30#
AND Q.Time <=#6:29#
UNION
SELECT "6:30 TO 8:29" AS TimeCalc, Count(*) AS TotalCalls
FROM Msys_obj AS Q
WHERE Q.Time >=#6:30#
AND Q.Time <=#8:29#
UNION
SELECT "8:30 TO 10:29" AS TimeCalc, Count(*) AS TotalCalls
FROM Msys_obj AS Q
WHERE Q.Time >=#8:30#
AND Q.Time <=#10:29#
UNION SELECT "10:30 TO 11:30" AS TimeCalc, Count(*) AS TotalCalls
FROM Msys_obj AS Q
WHERE Q.Time >=#10:30#
AND Q.Time <=#11:30#;

The table MSys_obj has a Time column with times recorded between :4:30 and 11:30

On the report, this is one of the text boxes: Calls between 4:30 and 6:29

In the control box I posted this expression: =DCount("=>#4:30#and=<#6:29#)","Time")

When I run the report, I get an #ERROR for the result for Calls between 4:30 and 6:29  

If someone wants to see my Db, let me know and I send it to you.

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/16/2026 4:08:25 PM. PLT: 0s