Dcount Used for Running Tally in Access Query and Outputing Text

A

Andrew Satorius

I am using a Dcount expression in the field to make a running tally in my
Make-Table Query based on Form inputs. I want to use the output data from
the Query to make a Chart.
The numbers are coming out correct...However, the DCount function is
outputting Text, vice Number to the Table and, as such, the chart doesn't
recognize it.
How can I make DCount output numbers? Or am I doing something else wrong?
Here is the expression:

InitiatedRTally:
DCount("[Primary]![DateInitiated]","[Primary]","DatePart('m',[Primary]![DateInitiated])="
& [SMonth] & " And DatePart('ww',[Primary]![DateInitiated])<=" & [SWeek] & "
And [Primary]![Site]=Forms![NewReportForm]![Sites] And
[Primary]![Team]=Forms![NewReportForm]![Teams]")

I am counting the number of Initiated requests by counting the
DateInititated field and then filtering by month, week, site and team.

Thank you for whatever help you could provide!
 
B

Brendan Reynolds

Andrew Satorius said:
I am using a Dcount expression in the field to make a running tally in my
Make-Table Query based on Form inputs. I want to use the output data from
the Query to make a Chart.
The numbers are coming out correct...However, the DCount function is
outputting Text, vice Number to the Table and, as such, the chart doesn't
recognize it.
How can I make DCount output numbers? Or am I doing something else wrong?
Here is the expression:

InitiatedRTally:
DCount("[Primary]![DateInitiated]","[Primary]","DatePart('m',[Primary]![DateInitiated])="
& [SMonth] & " And DatePart('ww',[Primary]![DateInitiated])<=" & [SWeek] &
"
And [Primary]![Site]=Forms![NewReportForm]![Sites] And
[Primary]![Team]=Forms![NewReportForm]![Teams]")

I am counting the number of Initiated requests by counting the
DateInititated field and then filtering by month, week, site and team.

Thank you for whatever help you could provide!


You could try wrapping the expression in a call to the Val() function ...

Val(DCount( etc ...

DCount() could potentially return Null though if there are no matching
errors, and that will cause an error if you try to pass it to the Val()
function so you may also need to use the NZ() function to handle any Null
values ..

Val(NZ(DCount( ... etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top