If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
TOTAL FEMALE AND MALE
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 |
#2
|
|||
|
|||
TOTAL FEMALE AND MALE
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]; -- Build a little, test a little. "Tia" wrote: 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 . |
Thread Tools | |
Display Modes | |
|
|