PLEASE HELP WITH THIS! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

PLEASE HELP WITH THIS!

hertsunihertsuni Posts: 1Member
I am trying to create a query in ms access which is a union.
The query counts how many applicants come from each town. However when I run the query it shows how many applicants come from each town in one row however you cannot tell which towns the applicants come from, all you get is a list of numbers.

Here is the query:

SELECT Count(tblApplicant.Town) AS No_Of_Applicants
FROM tblApplicant
WHERE (((tblApplicant.Town)='Buckinghamshire'));
UNION ALL
SELECT Count(tblApplicant.Town) AS No_Of_Applicants
FROM tblApplicant
WHERE (((tblApplicant.Town)='Essex'));
UNION ALL
SELECT Count(tblApplicant.Town) AS No_Of_Applicants
FROM tblApplicant
WHERE (((tblApplicant.Town)='Hertfordshire'));

Is there any way that I can get the number of applicants under the headings of the towns.
Please help
Thanks in advance.

Comments

  • SequinSequin Posts: 5Member
    Your query doesn't need to be a union query

    SELECT tblApplicant.Town, Count(tblApplicant.Town) AS No_Of_Applicants
    FROM tblApplicant
    WHERE tblApplicant.Town IN('Buckinghamshire','Essex''Hertfordshire')
    GROUP BY tblApplicant.Town;
Sign In or Register to comment.