Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to group data?

Status
Not open for further replies.

hawkeye71

Technical User
Feb 9, 2001
45
US
Hi Folks:
Table has a column which contains students country of birth, e.g. Germany, France, Sweden, China, Japan.
I want to find out the number of students from a region of the world, e.g. Asia, Europe.

I have written two queries to do this, one for the students from Asia and one for students from Europe.

In the criteria field I used "Japan" or "China" for Asian students, and I used "Germany" Or "France" or "Sweden" for European
students.

I want to write one query to get the required results.
I need help.
Also, I need a report that can use this query and display the student count by each region and then by country in that region.

Thanks,
Indiana
 
Try this

SELECT YourTable.Region, Sum(1) AS [Count]
FROM YourTable
GROUP BY YourTable.Region;

ChaZ

Ascii dumb question, get a dumb Ansi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top