Sum Column based on checkbox

G

Guest

I have a logical YES/NO check box. I need a calcuation that will Sum a
Duration of all entries checked "Yes". I have the following in the
expression builder for the text box on the report, but this sums ALL entries.

=Abs(Sum([Duration]))

Thanks
 
D

Duane Hookom

It would have helped tremendously if you had a name for "a logical YES/NO
check box".
Try something like:
=Sum(Abs([alYNcb]) * [Duration])
 
G

Guest

The name of the check box is "Invited". The duration is already calculated in
the query that is tied to the report.


--
I''m a novice with an advance way of thinking.


Duane Hookom said:
It would have helped tremendously if you had a name for "a logical YES/NO
check box".
Try something like:
=Sum(Abs([alYNcb]) * [Duration])

--
Duane Hookom
MS Access MVP

Beyuduzz said:
I have a logical YES/NO check box. I need a calcuation that will Sum a
Duration of all entries checked "Yes". I have the following in the
expression builder for the text box on the report, but this sums ALL
entries.

=Abs(Sum([Duration]))

Thanks
 
D

Duane Hookom

Did you apply my solution? Did it work?

--
Duane Hookom
MS Access MVP

Beyuduzz said:
The name of the check box is "Invited". The duration is already calculated
in
the query that is tied to the report.


--
I''m a novice with an advance way of thinking.


Duane Hookom said:
It would have helped tremendously if you had a name for "a logical YES/NO
check box".
Try something like:
=Sum(Abs([alYNcb]) * [Duration])

--
Duane Hookom
MS Access MVP

Beyuduzz said:
I have a logical YES/NO check box. I need a calcuation that will Sum a
Duration of all entries checked "Yes". I have the following in the
expression builder for the text box on the report, but this sums ALL
entries.

=Abs(Sum([Duration]))

Thanks
 
G

Guest

Yes, it did I had to make some modifications, but it got me pointed in the
right direction. Here is what I came up with:

**This one sums all "invited" meetings that are not cancelled
=Sum(Abs([invited] And [Cancelled]=False)*[Duration])

**This sums all "private" meetings that are not cancelled
=Sum(Abs([private] And [Cancelled]=False)*[Duration])

**This sums all meetings whether cancelled or not
=Sum(Abs([Duration]))

**This sums all cancelled meetings
=Sum(Abs([cancelled])*[Duration])

"invited", "Private", and "cancelled" are check boxes. "Duration" is a
column in the query that supports the report. "Duration:
DateDiff("n",[Setuptime],[EndTime])/60"
--
I''m a novice with an advance way of thinking.


Duane Hookom said:
Did you apply my solution? Did it work?

--
Duane Hookom
MS Access MVP

Beyuduzz said:
The name of the check box is "Invited". The duration is already calculated
in
the query that is tied to the report.


--
I''m a novice with an advance way of thinking.


Duane Hookom said:
It would have helped tremendously if you had a name for "a logical YES/NO
check box".
Try something like:
=Sum(Abs([alYNcb]) * [Duration])

--
Duane Hookom
MS Access MVP

I have a logical YES/NO check box. I need a calcuation that will Sum a
Duration of all entries checked "Yes". I have the following in the
expression builder for the text box on the report, but this sums ALL
entries.

=Abs(Sum([Duration]))

Thanks
 

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