TOTAL FEMALE AND MALE

  • Thread starter Thread starter Tia
  • Start date Start date
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
 
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];
 
Back
Top