Count or total a logocal field

G

Guest

Using Access 2k and XP, in Windows 2k and XP respectively

I am struggling with generating a total count of two fields in a report
footer. Both fields are "yes/No" type. I want to count the number of reported
entries that have the TrxCompleted field checked(TRUE).

I have set a text box in the footer and defined the source property using
the following formula =Count([TrxCompleted]=True). I have tried various
modifications to this, however results are either #error or -1.

What am I missing here??

Thanks in advance for your ideas and pointers.
 
M

Marshall Barton

JR said:
Using Access 2k and XP, in Windows 2k and XP respectively

I am struggling with generating a total count of two fields in a report
footer. Both fields are "yes/No" type. I want to count the number of reported
entries that have the TrxCompleted field checked(TRUE).

I have set a text box in the footer and defined the source property using
the following formula =Count([TrxCompleted]=True). I have tried various
modifications to this, however results are either #error or -1.

What am I missing here??


You're missing the fact that Count counts all non-Null
values. Try using:

=-Sum(TrxCompleted)

Note the minus sign.

This works because True is -1 and False is 0.
 
G

Guest

Thanks for your reply. UNfortunately, the =-Sum(TrxCompleted) still returns a
#Error message. Other suggestions!

Marshall Barton said:
JR said:
Using Access 2k and XP, in Windows 2k and XP respectively

I am struggling with generating a total count of two fields in a report
footer. Both fields are "yes/No" type. I want to count the number of reported
entries that have the TrxCompleted field checked(TRUE).

I have set a text box in the footer and defined the source property using
the following formula =Count([TrxCompleted]=True). I have tried various
modifications to this, however results are either #error or -1.

What am I missing here??


You're missing the fact that Count counts all non-Null
values. Try using:

=-Sum(TrxCompleted)

Note the minus sign.

This works because True is -1 and False is 0.
 
G

Guest

Is there any report or Access options that might disable the "Sum" function?
I added a purely numeric field to my report, then addeda total field to teh
page footer. entered =Sum(credit) as the control source. This returned a
numeric result one time only, after that first report, this control and my
original controls simply return a "#error". Suggestions?

Marshall Barton said:
JR said:
Using Access 2k and XP, in Windows 2k and XP respectively

I am struggling with generating a total count of two fields in a report
footer. Both fields are "yes/No" type. I want to count the number of reported
entries that have the TrxCompleted field checked(TRUE).

I have set a text box in the footer and defined the source property using
the following formula =Count([TrxCompleted]=True). I have tried various
modifications to this, however results are either #error or -1.

What am I missing here??


You're missing the fact that Count counts all non-Null
values. Try using:

=-Sum(TrxCompleted)

Note the minus sign.

This works because True is -1 and False is 0.
 
G

Guest

Do I ever feel foolish! All that time I had placed my formulas in the PAGE
footer. As soon as I moved them to the REPORT footer they work just like they
are supposed to. Bet I don't make that mistake again anytime soon!

Thanks Marshall, for your pointers!
 
M

Marshall Barton

JR said:
Do I ever feel foolish! All that time I had placed my formulas in the PAGE
footer. As soon as I moved them to the REPORT footer they work just like they
are supposed to. Bet I don't make that mistake again anytime soon!

Thanks Marshall, for your pointers!

I (and most everyone) can relate to that feeling ;-)
 

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

Similar Threads


Top