query help for beginner

C

Craig Reed

Hi -
As a project, I've created a table of data for an e-mail list I'm on. I've
got about 75 records on it, and would like to make several simple queries:

1. How many people are in each country, and how many records don't specify
a country.

2. I've got a Country field, a Region field, a State field, and a City
field. Using only the USA records, I'd like to group all the USA records
by both region & state.

extra credit: could someone point out a good web page on building queries?

Thanks
Craig
 
D

Douglas J. Steele

Afraid I don't know a web page specific to queries, but here are answers to
your questions.

1. Create a new query, and add your table to it. Drag the Country field and
one other field down into the grid. Click on the Sigma button (or select
View | Totals from the menu bar if you can't figure out what I'm talking
about). A new row "Total:" will appear in the grid (as the 3rd row). Leave
"Group By" under Country, but change it to "Count" under the other field you
added. Run the query.

2. Not quite sure what you mean by group, but assuming that you just want to
sort by region and state, create a new query and add your table to it. Drag
Country, Region, State, City and whatever other fields you care about down
into the grid. On the row labelled "Criteria:", type USA underneath the
Country field. Assuming that Region appears in the grid to the left of
State, choose "Ascending" in the Sort row under Region, and also under
State. If Region appears in the grid to the right of State, drag a second
copy of the State field to the grid to the right of Region. Uncheck the box
on the Show: row underneath this second State field. Now, choose "Ascending"
underneath Region and under the second State field.

You could try looking for a copy of "SQL Queries for Mere Mortals", by
Michael Hernandez and John Viescas
http://www.amazon.com/exec/obidos/tg/detail/-/0201433362/103-8754635-6251050?v=glance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top