Summing 2 different values in a report

R

Ron

I have a report with a lot of calculations on it.
The report is connected to an unbound Form which is
connected to a query that allows the user to choose values
which will determine how the report will pull the data.
Now there is a field on the report called [MonitorType].
There is also a field called [Demeanor].
[MonitorType] is a combobox that will display a value of
1=Scheduled or 2=Remote depending on what is chosen on the
unbound form.
[Demeanor] is just a text box that will hold a point value.
What the report does now is just sum up the values of
Demeanor no matter what value MonitorType displays.
What I would like the report to do is sum all the values
of Demeanor if MonitorType=1 and also in a seperate field
sum all the values of Demeanor if MonitorType=2.
Is it possible to seperate out the records like that on a
report so that you can sum different values on the same
field. And if so...How can it be done?
I have this basic formula in 2 different fields:
Name = sumofdemeanor
ControlSource=IIf([MonitorTypeID]=2,Sum([Demeanor]))
Name = sumofdemeanor-scd
ControlSource=IIf([MonitorTypeID]=1,Sum([Demeanor]))
but it can't seperate out the records according to
MonitorType to get different sums. It just sums all of the
records in Demeanor.

Any thoughts? Thanks in advance for your help.
Ron
 
M

Marshall Barton

Ron said:
I have a report with a lot of calculations on it.
The report is connected to an unbound Form which is
connected to a query that allows the user to choose values
which will determine how the report will pull the data.
Now there is a field on the report called [MonitorType].
There is also a field called [Demeanor].
[MonitorType] is a combobox that will display a value of
1=Scheduled or 2=Remote depending on what is chosen on the
unbound form.
[Demeanor] is just a text box that will hold a point value.
What the report does now is just sum up the values of
Demeanor no matter what value MonitorType displays.
What I would like the report to do is sum all the values
of Demeanor if MonitorType=1 and also in a seperate field
sum all the values of Demeanor if MonitorType=2.
Is it possible to seperate out the records like that on a
report so that you can sum different values on the same
field. And if so...How can it be done?
I have this basic formula in 2 different fields:
Name = sumofdemeanor
ControlSource=IIf([MonitorTypeID]=2,Sum([Demeanor]))
Name = sumofdemeanor-scd
ControlSource=IIf([MonitorTypeID]=1,Sum([Demeanor]))
but it can't seperate out the records according to
MonitorType to get different sums. It just sums all of the
records in Demeanor.

I think maybe this might be what you want:

=Sum(IIf([MonitorTypeID]=1, [Demeanor], 0)
 
R

Ron V

Marshall Thank you. It worked perfectly.
-----Original Message-----
Ron said:
I have a report with a lot of calculations on it.
The report is connected to an unbound Form which is
connected to a query that allows the user to choose values
which will determine how the report will pull the data.
Now there is a field on the report called [MonitorType].
There is also a field called [Demeanor].
[MonitorType] is a combobox that will display a value of
1=Scheduled or 2=Remote depending on what is chosen on the
unbound form.
[Demeanor] is just a text box that will hold a point value.
What the report does now is just sum up the values of
Demeanor no matter what value MonitorType displays.
What I would like the report to do is sum all the values
of Demeanor if MonitorType=1 and also in a seperate field
sum all the values of Demeanor if MonitorType=2.
Is it possible to seperate out the records like that on a
report so that you can sum different values on the same
field. And if so...How can it be done?
I have this basic formula in 2 different fields:
Name = sumofdemeanor
ControlSource=IIf([MonitorTypeID]=2,Sum([Demeanor]))
Name = sumofdemeanor-scd
ControlSource=IIf([MonitorTypeID]=1,Sum([Demeanor]))
but it can't seperate out the records according to
MonitorType to get different sums. It just sums all of the
records in Demeanor.

I think maybe this might be what you want:

=Sum(IIf([MonitorTypeID]=1, [Demeanor], 0)
 

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