View Full Version : Simple Count Question


bacarat
07-27-2007, 01:31 PM
Hi,
Im trying to run a query, field name is [Value]. I have yes or no boxes in this field, I set the sum to count and under criteria i have put yes, no, -1, and 0 and they will not correctly add up. When i try yes it counts all of my records. Any help would be great. Thanks.

Moniker
07-27-2007, 05:16 PM
Value is a keyword. Bad bad.

Change that field name, and then the SQL will look like this:

SELECT COUNT([NewFieldNameForValue]) FROM YourTableName;

If you're trying to find all the Checkboxes that are checked, it's this:

SELECT COUNT([NewFieldNameForValue]) FROM YourTableName WHERE [NewFieldNameForValue] = -1;

bacarat
07-30-2007, 07:56 AM
Works! Thanks for the help and tips.