TOTAL FEMALE AND MALE

T

Tia

hello,

i have a list of employees with gender male/female once i click on
gender i choose female or male
how can i know the total of male and female in this list
i used this one, but it is not working
gender:CDbl(Sum(nz[DATABASE Query.GENDER] ,0)))
im getting tHAT THE EXPRESSION THAT I ENTERED CONTAINS INVALID SYNTHAX
YU MAY HAVE ENTERED AND OPERAND WITHOUT AN OPERATOR
 
K

KARL DEWEY

It will vary according to how your data is stored.
Here is one --
SELECT Sum(IIF([DATABASE Query].[GENDER] ="Male", 1, 0)) AS Count_of_Males,
Sum(IIF([DATABASE Query].[GENDER] ="Female", 1, 0)) AS Count_of_Females
FROM [DATABASE Query];

Another --
SELECT Sum(IIF([DATABASE Query].[GENDER] ="M", 1, 0)) AS Count_of_Males,
Sum(IIF([DATABASE Query].[GENDER] ="F", 1, 0)) AS Count_of_Females
FROM [DATABASE Query];

Again --
SELECT Sum(IIF([DATABASE Query].[GENDER] = 1, 1, 0)) AS Count_of_Males,
Sum(IIF([DATABASE Query].[GENDER] = 2, 1, 0)) AS Count_of_Females
FROM [DATABASE Query];

Or --
SELECT Sum(IIF([DATABASE Query].[GENDER] = -1, 1, 0)) AS Count_of_Males,
Sum(IIF([DATABASE Query].[GENDER] = 0, 1, 0)) AS Count_of_Females
FROM [DATABASE Query];
 

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