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 
Dcount between dates
Brandon Jackson 
    
10 years ago
I have an issue with my function: =DCount("*","ReworkSearchQ","ReworkDate >= DateSerial(Year(Date()),1,1)  AND < DateSerial(Year(Date()),2,1)")
I'm using this as the control source for an unbound text box on a form but it just gives an #ERROR message.  However, if you remove the inequalities and use the BETWEEN keyword, then it works, but this isn't what I need.  I need just the dates for January.  If I put the where condition part of this in the criteria section of a query, it works then.  Can you please tell me what I'm doing wrong?  Thank you very much!


Reply from Alex Hedley:

Original
=DCount("*","ReworkSearchQ","ReworkDate >= DateSerial(Year(Date()),1,1) AND < DateSerial(Year(Date()),2,1)")

I think you're missing what you are comparing on the second check, try adding the Field "ReworkDate" before the "<"

New
=DCount("*","ReworkSearchQ","ReworkDate >= DateSerial(Year(Date()),1,1) AND ReworkDate < DateSerial(Year(Date()),2,1)")

You might also need to wrap the dates in "#"s.
MyDate >= #10/30/2016# And MyDate < #11/30/2016#

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/15/2026 2:59:51 AM. PLT: 1s