A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

TOTAL FEMALE AND MALE



 
 
Thread Tools Display Modes
  #1  
Old November 20th, 2009, 02:47 AM posted to microsoft.public.access.forms
Tia[_3_]
external usenet poster
 
Posts: 126
Default 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  
Old November 20th, 2009, 06:28 AM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.