DCount Function with Input Parameters

  • Thread starter Thread starter Anita Taylor
  • Start date Start date
A

Anita Taylor

I'm trying to run a report that will count the number of
issues entered into a call-tracking system for a selected
date range.

I've tried the following, but keep coming up with 0
results.

=DCount("[issue_number]","issues","([date_opened]" Between
[StartDate] And [EndDate])

I would appreciate any pointers in the right direction.
 
I've tried the following, but keep coming up with 0
results.

=DCount("[issue_number]","issues","([date_opened]" Between
[StartDate] And [EndDate])

Try this:

=DCount("[issue_number]","issues", "[date_opened] Between "& [StartDate] &
"And" & [EndDate])

Tom Lake
 
With this syntax, I'm getting #Error when I display the
report.

Any other thoughts?

My bad. Try this:

=DCount("[issue_number]","issues","[date_opened] between #" & [startdate] &
"# and #" & [enddate] & "#")

Tom Lake
 
If your report is based on the table/query "Issues" then using DCount() is a
waste of resources. If the report is limited to the date range then just
use:
=Count("[Issue_Number]")
If the report isn't filter by the date range then use:

=Sum(Abs([date_opened] >= [startdate] And [Date_Opened] <= [enddate]))

--
Duane Hookom
MS Access MVP


Tom Lake said:
With this syntax, I'm getting #Error when I display the
report.

Any other thoughts?

My bad. Try this:

=DCount("[issue_number]","issues","[date_opened] between #" & [startdate] &
"# and #" & [enddate] & "#")

Tom Lake
 
Back
Top