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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Zip Code Count
|
#2
|
|||
|
|||
On Thu, 6 Oct 2005 10:57:43 -0400, "Glenn Dulmage"
wrote: I want to make a count of 5 Zip codes from a small database of about 3,000 records. How do I do this (i.e. what sort of query, what grouping and counting)? Use a query which does what you want. Since you seem to know what you want, but have not clearly stated it, it's a bit hard to say! What do you mean by "count of 5 zip codes"? Do you mean to select five particular zip codes out of others in the table and count the total number of records in that set, or do you mean a count of records in each zip code, or what? John W. Vinson[MVP] |
#3
|
|||
|
|||
John,
Thanks for the reply. What I mean "a count of 5 Zip codes" is 5 zip codes out of perhaps several hundred. I need to supply this information to the local Post Office every time a mass mailing is sent by a local non-profit organization (not asking for money ). "John Vinson" wrote in message ... On Thu, 6 Oct 2005 10:57:43 -0400, "Glenn Dulmage" wrote: I want to make a count of 5 Zip codes from a small database of about 3,000 records. How do I do this (i.e. what sort of query, what grouping and counting)? Use a query which does what you want. Since you seem to know what you want, but have not clearly stated it, it's a bit hard to say! What do you mean by "count of 5 zip codes"? Do you mean to select five particular zip codes out of others in the table and count the total number of records in that set, or do you mean a count of records in each zip code, or what? John W. Vinson[MVP] |
#4
|
|||
|
|||
On Thu, 6 Oct 2005 15:42:54 -0400, "Glenn Dulmage"
wrote: John, Thanks for the reply. What I mean "a count of 5 Zip codes" is 5 zip codes out of perhaps several hundred. I need to supply this information to the local Post Office every time a mass mailing is sent by a local non-profit organization (not asking for money ). Ok... I'll assume you have a table named Mailings with a primary key MailingID and a field Zip (adjust these names to match your own table). Create a query by adding Mailings to the query grid; select MailingID and Zip. Click the Greek Sigma icon (looks like a sideways W) to make it a Totals query. Change the default Group By operator on MailingID to Count, and to Where on Zip. On the Criteria line under Zip type IN("48823", "72712", "02338", "83660", "98023") to find some of my former residences (or your own preferred codes...) Add any other needed criteria similarly using the Where operator. Open the query and you should see a single record with the count of records. John W. Vinson[MVP] |
#5
|
|||
|
|||
Perhaps I'm doing something wrong. What I get is a single record of a total
count of all the 5 zip codes (CountofZip 284). What I need is the count of each zip code. Field Count 21620 218 21661 44 21644 12 23265 8 22547 2 Is there a way to do this. Or can I do a Report based on this query which Groups By the zip and will give a count? Thanks ----- Original Message ----- From: "John Vinson" Newsgroups: microsoft.public.access.queries Sent: Thursday, October 06, 2005 6:28 PM Subject: Zip Code Count On Thu, 6 Oct 2005 15:42:54 -0400, "Glenn Dulmage" wrote: John, Thanks for the reply. What I mean "a count of 5 Zip codes" is 5 zip codes out of perhaps several hundred. I need to supply this information to the local Post Office every time a mass mailing is sent by a local non-profit organization (not asking for money ). Ok... I'll assume you have a table named Mailings with a primary key MailingID and a field Zip (adjust these names to match your own table). Create a query by adding Mailings to the query grid; select MailingID and Zip. Click the Greek Sigma icon (looks like a sideways W) to make it a Totals query. Change the default Group By operator on MailingID to Count, and to Where on Zip. On the Criteria line under Zip type IN("48823", "72712", "02338", "83660", "98023") to find some of my former residences (or your own preferred codes...) Add any other needed criteria similarly using the Where operator. Open the query and you should see a single record with the count of records. John W. Vinson[MVP] |
#6
|
|||
|
|||
On Fri, 7 Oct 2005 08:12:26 -0400, "Glenn Dulmage"
wrote: Perhaps I'm doing something wrong. What I get is a single record of a total count of all the 5 zip codes (CountofZip 284). What I need is the count of each zip code. Thank you for saying this. "A count of 5 zip codes" - which you asked for previously - is ambiguous. It could mean five separate counts or one count. I guessed which you meant, and guessed wrong. Field Count 21620 218 21661 44 21644 12 23265 8 22547 2 Is there a way to do this. Or can I do a Report based on this query which Groups By the zip and will give a count? Select the Zip field a second time in the query, and leave the default Group By set on it. John W. Vinson[MVP] |
#7
|
|||
|
|||
Wow! Worked like a charm.
Thanks, Glenn "John Vinson" wrote in message ... On Fri, 7 Oct 2005 08:12:26 -0400, "Glenn Dulmage" wrote: Perhaps I'm doing something wrong. What I get is a single record of a total count of all the 5 zip codes (CountofZip 284). What I need is the count of each zip code. Thank you for saying this. "A count of 5 zip codes" - which you asked for previously - is ambiguous. It could mean five separate counts or one count. I guessed which you meant, and guessed wrong. Field Count 21620 218 21661 44 21644 12 23265 8 22547 2 Is there a way to do this. Or can I do a Report based on this query which Groups By the zip and will give a count? Select the Zip field a second time in the query, and leave the default Group By set on it. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I can receive email but cannot send it. | pegasus | General Discussion | 175 | April 27th, 2010 05:49 PM |
Count Code Help Needed, Please | Dave Elliott | Using Forms | 4 | April 29th, 2005 07:34 PM |
Conversion | SVC | Worksheet Functions | 9 | February 28th, 2005 02:29 PM |
Conversion of excel vba code to access vba | filnigeria | General Discussion | 5 | July 15th, 2004 02:23 AM |
Expression - calculating running total | Kathy | Running & Setting Up Queries | 26 | June 22nd, 2004 10:14 PM |