query totals

L

Larry

I have property ids and key tag field. If property has a key it is assigned a
number of the key tag otherwise value is zero. I am trying to get a query
with total number of keys (i.e, key tag field>0) and total number of "no key"
(i.e., key tag field=0). I can't get the results. Ultimately I want to show
this as a pie chart once I have the query.
 
D

Dennis

Create a query with 2 columns. In The first column type this
KeyTag: iif(KeyTagField > 0 , 1 , 0)
In the 2nd column put the Keytag field. Click the totals button, leave
column 1 as group by but change column 2 to Count.
Run the query.
 
L

Larry

Bingo! Great! But how do I know which number corrisponds to which result?
First row was 324, second row was 114. Is there a way to put labels for each
row or similar? thanks!
 
D

Dennis

The first column showuld be 1 or 0. The 1 is where the Key tag fields are
greater than zero and the 0 is where they are zero. You could change column 1
to this if you prefer.
KeyTag: iif(KeyTagField > 0 , "Geater than zero" , "Equal to zero")
 
Top