Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding yes/no fields

Status
Not open for further replies.

TheEnigma

Technical User
May 26, 2002
69
US
If anyone could help me I would really appreciate it! :) I have set up a table that has "yes/no" fields in it. The yes fields which I need to calculate from come up as -1. So in both a query and a report when I total the figures from that column I get a minus figure. E.g. 5 ticks in the yes column give me a total of -5.

Can anyone tell me how to get around this please?

 
You need to "count" the field, not sum or total it.
 
I tried this but when you have previously ticked a field then unticked it, it then leaves a 0 in the field that was previously -1. Then when you run the report or query it counts the fields with 0 in them.

Basically the fields are for a person who can be yes/no or maybe. A person might initially be a maybe, then change their minds and become a "yes". Alternatively they might be a "yes" and then change their minds and be a no.

Any other suggestions? (thanks for your ideas though! :) )
 
If you have a query, is this a Totals Query?

If so you can add fields to count yeses and no's:

FieldYes: IIf([Manager]=-1,[Manager])

FieldNo: IIf([Manager]=0,[Manager])

Set these fields to "Count".
If you are in a report, I'd have to check on that but I think you can adapt this to a control, too.

You may want to post your query.



Hope this helps
 
Hi,

See thread thread705-361544

Acouple of ways that are easy are

=Sum(iif([Name of Checkbox] = -1,1,0))

or

=Sum(abs([Name of Checkbox))

Hope these help
Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
Thank you very much! :) I am back in action! Yipeeee.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top