Counting Records

AdmiralJonB

New member
Local time
Today, 18:51
Joined
Nov 23, 2004
Messages
7
I'm not quite sure what to search for on this, so here's my question.

I'm wanting to do a standard counting field in a query, but with criteria i'm not sure how to write.

I want it to count the number of a certain field (In this case Turkey ID (don't ask)), which i know how to do. It is related to another table (Orders) which has a true/false field. What I want to do is count the Turkey IDs that in the related Orders table is set to false. (Is this clear enough?) How could I do this?

Thanks
 
Just have your query display only those two fields, count the Turkey ID (I really want to ask though!!) field and the yes/no field, and set the criteria for the yes/no field to "0" (zero, but without the quotes). That is the default boolean for no so it will only return those values which have no as the entry.

Quick point though, if you have the yes/no field default to no, then this will work, otherwise you'll have to run an update query first to change all of the null values in this field to no, then run the count.

Alternatively, use "<>-1" as the criteria in your yes/no field (i.e.: not equal to -1, the boolean for yes in access)
 
create a total query i.e. while you are in the query desing view click on the sigma symbol to get a new row (total row). Then from this new row, under the field TurkeyID select "Count" and under the field from the order's table field select "Where", then in the criteria row type False.
 

Users who are viewing this thread

Back
Top Bottom