Posted in General

Miss. / Mrs. Stranger Email : Access Query

This email was about Access Query.

Plz check this question in dotnet spider on sqlserver.
I need the output in access.I dont have proper touch
in access.Can u help this out by checking.

Thnks in advance.
keep smiling,

The post talks about a database Table with CityName, PersonName and Sex (M/F). A person wants to get List of all cities and number of Males and Females in output. The person who sent me an email answered in the post with correct query. But she had troubles getting it in MS Access. This is how access we can write the query in Access. I checked it it works.

SELECT CityName, SUM(IsMale) As NoOfMales, SUM(IsFemale) As NoOfFemales
SELECT CityName, IIF(Sex='M', 1,0)As IsMale, IIF(Sex='F', 1,0) as IsFemale
FROM Citytable
) GROUP BY CityName;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s