Calulation In Report Footer (Summary)

J

JC

I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 
D

Duane Hookom

I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
 
J

JC

Thanks for the reply. I have tried that, and it is basically asking asking
me for a zone number. Once I make the input, it then gives the total of all
zones, instead of each zone seperately. I can acheive that with a simple
equation. To clarify:

I would like for it to not ask for any input, and just display the total for
each zone, in seperate lines, such as;

Zone 1 - $1,200
Zone 2 - $1,200

Thanks again for your assistance
Duane Hookom said:
I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
--
Duane Hookom
Microsoft Access MVP


JC said:
I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 
D

Duane Hookom

Do you have a field named Zone? You won't be asked for zone if there is a
field named zone in your report's record source.

What are the fields in your report? What are their data types?

--
Duane Hookom
Microsoft Access MVP


JC said:
Thanks for the reply. I have tried that, and it is basically asking asking
me for a zone number. Once I make the input, it then gives the total of all
zones, instead of each zone seperately. I can acheive that with a simple
equation. To clarify:

I would like for it to not ask for any input, and just display the total for
each zone, in seperate lines, such as;

Zone 1 - $1,200
Zone 2 - $1,200

Thanks again for your assistance
Duane Hookom said:
I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
--
Duane Hookom
Microsoft Access MVP


JC said:
I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 
J

JC

That did the trick. There was a prefix to the Zone. I would like to ask for
your assistance for other thing in this area: How would I get the same
summary to display each areas dollar total? For example:

Zone 1 Pay=$500.00 Mileage=$300.00 Fuel=$200.00 Total Pay=$1,000?

Thanks again.

Duane Hookom said:
Do you have a field named Zone? You won't be asked for zone if there is a
field named zone in your report's record source.

What are the fields in your report? What are their data types?

--
Duane Hookom
Microsoft Access MVP


JC said:
Thanks for the reply. I have tried that, and it is basically asking asking
me for a zone number. Once I make the input, it then gives the total of all
zones, instead of each zone seperately. I can acheive that with a simple
equation. To clarify:

I would like for it to not ask for any input, and just display the total for
each zone, in seperate lines, such as;

Zone 1 - $1,200
Zone 2 - $1,200

Thanks again for your assistance
Duane Hookom said:
I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
--
Duane Hookom
Microsoft Access MVP


:

I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 
D

Duane Hookom

When you start getting so many subtotals, you would be better off creating a
totals query and using it as the record source of a subreport.

You should be able to figure out how to get an expression like
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
to only display "each areas" (whatever an area is).

If you can't figure this out, come back and tell us more about your fields
and values and data types and what is "each area".
--
Duane Hookom
Microsoft Access MVP


JC said:
That did the trick. There was a prefix to the Zone. I would like to ask for
your assistance for other thing in this area: How would I get the same
summary to display each areas dollar total? For example:

Zone 1 Pay=$500.00 Mileage=$300.00 Fuel=$200.00 Total Pay=$1,000?

Thanks again.

Duane Hookom said:
Do you have a field named Zone? You won't be asked for zone if there is a
field named zone in your report's record source.

What are the fields in your report? What are their data types?

--
Duane Hookom
Microsoft Access MVP


JC said:
Thanks for the reply. I have tried that, and it is basically asking asking
me for a zone number. Once I make the input, it then gives the total of all
zones, instead of each zone seperately. I can acheive that with a simple
equation. To clarify:

I would like for it to not ask for any input, and just display the total for
each zone, in seperate lines, such as;

Zone 1 - $1,200
Zone 2 - $1,200

Thanks again for your assistance
:

I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
--
Duane Hookom
Microsoft Access MVP


:

I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 
J

JC

Thanks very much. I will definitely let you know if I need more assitance.
You saved me a lot of headaches.

Duane Hookom said:
When you start getting so many subtotals, you would be better off creating a
totals query and using it as the record source of a subreport.

You should be able to figure out how to get an expression like
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
to only display "each areas" (whatever an area is).

If you can't figure this out, come back and tell us more about your fields
and values and data types and what is "each area".
--
Duane Hookom
Microsoft Access MVP


JC said:
That did the trick. There was a prefix to the Zone. I would like to ask for
your assistance for other thing in this area: How would I get the same
summary to display each areas dollar total? For example:

Zone 1 Pay=$500.00 Mileage=$300.00 Fuel=$200.00 Total Pay=$1,000?

Thanks again.

Duane Hookom said:
Do you have a field named Zone? You won't be asked for zone if there is a
field named zone in your report's record source.

What are the fields in your report? What are their data types?

--
Duane Hookom
Microsoft Access MVP


:

Thanks for the reply. I have tried that, and it is basically asking asking
me for a zone number. Once I make the input, it then gives the total of all
zones, instead of each zone seperately. I can acheive that with a simple
equation. To clarify:

I would like for it to not ask for any input, and just display the total for
each zone, in seperate lines, such as;

Zone 1 - $1,200
Zone 2 - $1,200

Thanks again for your assistance
:

I expect Zone is a numeric field in your report. I also assume there are no
nulls in Pay, Fuel, and Miles fields. Try:
=Sum(Abs([Zone]=1) * (pay+fuel+miles))
=Sum(Abs([Zone]=2) * (pay+fuel+miles))
-- etc --
If my assumptions are wrong, either correct them or come back with
clarification.
--
Duane Hookom
Microsoft Access MVP


:

I hope I explain this well.

I have a report in which I need the sum of three fields (pay+fuel+miles) for
four different zones (Zone1, Zone2, Zone3,Zone4) in the report footer.

The report derives its' information from a query that displays this
information by zone, and it summarizes this information for each zone
correctly.

I have tried using DSum("[total pay]", "TotalPay", "[Zone] = '1'"), but the
report only displays '#error'.

Please help. Thank you
 

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