DCOUNT function in a subreport

G

Guest

I have a report with a subreport, that opens based on amacor with specific
date criteria. I need to count the number of times, per group, that there was
an "Exchange Fee" charged. I have typed the function as such:

=DCount("[SERVICE]","[Travelocity Air Travel Service Fee Data]","[SERVICE] =
'EXCHANGE FEE' ")

However it is giving me the total for the entire report not just within my
date range or by group. Each group is listed with the same amount.
 
D

Duane Hookom

If you need to count the number of times a condition/expression is true in a
report, use something like:

=Sum(Abs(condition/expression ))

You might be able to use
=Sum(Abs([SERVICE] = "EXCHANGE FEE"))
 
G

Guest

Thanks that work great, does this expression work if I need to count the
number of times a value is greater than another number?is between tow number?
or is less than another number?

Duane Hookom said:
If you need to count the number of times a condition/expression is true in a
report, use something like:

=Sum(Abs(condition/expression ))

You might be able to use
=Sum(Abs([SERVICE] = "EXCHANGE FEE"))

--
Duane Hookom
MS Access MVP


T-bird said:
I have a report with a subreport, that opens based on amacor with specific
date criteria. I need to count the number of times, per group, that there
was
an "Exchange Fee" charged. I have typed the function as such:

=DCount("[SERVICE]","[Travelocity Air Travel Service Fee Data]","[SERVICE]
=
'EXCHANGE FEE' ")

However it is giving me the total for the entire report not just within my
date range or by group. Each group is listed with the same amount.
 
D

Duane Hookom

Try it.... This should take less time to test on your own than to ask
someone.


--
Duane Hookom
MS Access MVP

T-bird said:
Thanks that work great, does this expression work if I need to count the
number of times a value is greater than another number?is between tow
number?
or is less than another number?

Duane Hookom said:
If you need to count the number of times a condition/expression is true
in a
report, use something like:

=Sum(Abs(condition/expression ))

You might be able to use
=Sum(Abs([SERVICE] = "EXCHANGE FEE"))

--
Duane Hookom
MS Access MVP


T-bird said:
I have a report with a subreport, that opens based on amacor with
specific
date criteria. I need to count the number of times, per group, that
there
was
an "Exchange Fee" charged. I have typed the function as such:

=DCount("[SERVICE]","[Travelocity Air Travel Service Fee
Data]","[SERVICE]
=
'EXCHANGE FEE' ")

However it is giving me the total for the entire report not just within
my
date range or by group. Each group is listed with the same amount.
 
G

Guest

Thanks, I got it to work with the >=< however it is counting those records
that appear more than (duplicates) once as one single record rather than two.
Is there a way to count the record each time it shows up? I have my control
listed as:

=Sum((Abs([DAYSADV]>=21)))

Duane Hookom said:
Try it.... This should take less time to test on your own than to ask
someone.


--
Duane Hookom
MS Access MVP

T-bird said:
Thanks that work great, does this expression work if I need to count the
number of times a value is greater than another number?is between tow
number?
or is less than another number?

Duane Hookom said:
If you need to count the number of times a condition/expression is true
in a
report, use something like:

=Sum(Abs(condition/expression ))

You might be able to use
=Sum(Abs([SERVICE] = "EXCHANGE FEE"))

--
Duane Hookom
MS Access MVP


I have a report with a subreport, that opens based on amacor with
specific
date criteria. I need to count the number of times, per group, that
there
was
an "Exchange Fee" charged. I have typed the function as such:

=DCount("[SERVICE]","[Travelocity Air Travel Service Fee
Data]","[SERVICE]
=
'EXCHANGE FEE' ")

However it is giving me the total for the entire report not just within
my
date range or by group. Each group is listed with the same amount.
 
D

Duane Hookom

Sorry, I can't see your records so I have no idea what is being duplicated
or why.
--
Duane Hookom
MS Access MVP

T-bird said:
Thanks, I got it to work with the >=< however it is counting those records
that appear more than (duplicates) once as one single record rather than
two.
Is there a way to count the record each time it shows up? I have my
control
listed as:

=Sum((Abs([DAYSADV]>=21)))

Duane Hookom said:
Try it.... This should take less time to test on your own than to ask
someone.


--
Duane Hookom
MS Access MVP

T-bird said:
Thanks that work great, does this expression work if I need to count
the
number of times a value is greater than another number?is between tow
number?
or is less than another number?

:

If you need to count the number of times a condition/expression is
true
in a
report, use something like:

=Sum(Abs(condition/expression ))

You might be able to use
=Sum(Abs([SERVICE] = "EXCHANGE FEE"))

--
Duane Hookom
MS Access MVP


I have a report with a subreport, that opens based on amacor with
specific
date criteria. I need to count the number of times, per group, that
there
was
an "Exchange Fee" charged. I have typed the function as such:

=DCount("[SERVICE]","[Travelocity Air Travel Service Fee
Data]","[SERVICE]
=
'EXCHANGE FEE' ")

However it is giving me the total for the entire report not just
within
my
date range or by group. Each group is listed with the same amount.
 

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