Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dcount using Date Range

Status
Not open for further replies.

HomeALone

Instructor
Jul 20, 2001
110
US
I have the following expression in a query column to count records:

NumberRecords: Dcount("RecordID","RecordTable","[IssueDate] = Between [Enter Start Date] And [Enter End Date]")

This doesn't work. What did I do wrong? Thanks!
 
It looks like you have to take out the equal sign in your criteria:
Code:
NumberRecords: Dcount("RecordID","RecordTable","[IssueDate] Between [Enter Start Date] And [Enter End Date]")
 
Still got syntax error after taking out the "=" sign. I wonder whether we can use "Between" & "And" in Dcount!!
 
I just found this in Access help:

Any field that is included in criteria must also be a field in domain; otherwise the DCount function returns a Null.


Is there a query as the record source for this report?? Then, the date parameters could be in your query, and the count could be accomplished in your report with a simple
Code:
 =Count(*)
in the report footer.......
 
Yeah, your suggestion should work; logically.

What am I trying to accomphish is to create 3 columns (3 different counts), each is counting diferrent things are done in that same date range. For example, the first one I am trying to count is the records ISSUED within that date range. 2nd one will be records that are APPROVED on the same date range. And the 3rd will be records that are CLOSED on the same date range. Once these three columns are created(counted), I then chart a Bar report about the progress within the date range.

Thank you for shedding some lights on this project!
 
I solved the problem, I am going to post it here just in case someone will have the same problem in the future.

NumberRecords: Dcount("RecordID","RecordTable","[IssueDate] Between #" & [Enter Start Date] & "# And #" & [Enter End Date]& "#")

The # sign need to be added because date used.

Case closed!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top