How do I calculate checked boxes in a report or query?

L

leona

I have created a table and a form with yes/no checked boxes, now I'd like to
make a report or a query and in this I'd like to calculate how much was done
(according to a checked box) from a respective year. How can I do this?
 
L

leona

Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))

--
KARL DEWEY
Build a little - Test a little


leona said:
I have created a table and a form with yes/no checked boxes, now I'd like to
make a report or a query and in this I'd like to calculate how much was done
(according to a checked box) from a respective year. How can I do this?
 
J

John Spencer

That is not criteria. It is a calculated field and belongs in a field
"cell" on your query in place of the checkbox.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

leona said:
Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))

--
KARL DEWEY
Build a little - Test a little


leona said:
I have created a table and a form with yes/no checked boxes, now I'd
like to
make a report or a query and in this I'd like to calculate how much was
done
(according to a checked box) from a respective year. How can I do this?
 
K

KARL DEWEY

Tanks for replying, what do you mean "date criteria"?
You said 'from a respective year' so you will need criteria on your date
field in addition to summing the Yes checks.

As John said you need to put Sum(Abs(Nz([YourCheckBox],0))) in the field
row of the query design view grid.
--
KARL DEWEY
Build a little - Test a little


leona said:
Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))

--
KARL DEWEY
Build a little - Test a little


leona said:
I have created a table and a form with yes/no checked boxes, now I'd like to
make a report or a query and in this I'd like to calculate how much was done
(according to a checked box) from a respective year. How can I do this?
 
L

leona

Thanks, so I add this in the field cell with the correct name of the checkbox
for each one I'd need, when I go to see the datasheet view it pops: "Data
type mismatch in criteria expression" - what did I do wrong?
Thanks again.

John Spencer said:
That is not criteria. It is a calculated field and belongs in a field
"cell" on your query in place of the checkbox.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

leona said:
Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))

--
KARL DEWEY
Build a little - Test a little


:

I have created a table and a form with yes/no checked boxes, now I'd
like to
make a report or a query and in this I'd like to calculate how much was
done
(according to a checked box) from a respective year. How can I do this?
 
D

derek

Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))
"leona" wrote:

try

sum(iif( checkbox1= true,1,0))
 
L

leona

Thanks, the previous one worked... I figured it out ;)

Tanks for replying, what do you mean "date criteria"?
In my query I've only inserted the fields I need, they're all fields with
"yes/no" format and I'd like to "add" the checked boxes.

If I add Sum(Abs(Nz([YourCheckBox],0))) in the criteria, under a field of
"yes/no" it gives me an error message.

Please help. Thanks.

KARL DEWEY said:
Use date criteria and this for the count ---
Sum(Abs(Nz([YourCheckBox],0)))
"leona" wrote:
I have created a table and a form with yes/no checked boxes, now I'd like to
make a report or a query and in this I'd like to calculate how much was done
(according to a checked box) from a respective year. How can I do this?

try

sum(iif( checkbox1= true,1,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