Results 1 to 6 of 6

Thread: Filter/Count zip code

  1. #1
    Join Date
    Aug 2006
    Posts
    9

    Filter/Count zip code

    Hi all,
    I have a column of zip codes. I would like to filter by how many different zip codes there are. I have about 65,000 records, so who knows how many.

    I'm using ACESS 2000, on XP.

    Thanks

  2. #2
    Join Date
    May 2006
    Posts
    407
    SELECT ZipCode, Count(*) as CountOfZip FROM tblTableName
    GROUP BY ZipCode

    Of course you will need to use the real name for your zip code field, and the real name of the table you are dealing with. Now, to find out how many different zip codes you are dealing with, see how many records this query produces, and that will be the number of zip codes you are dealing with.

  3. #3
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    Reading your question you want to select using zip codes eliminating duplicate zip codes not count how many different zio codes there are in the table.

    To do this use the DISTINCT in your query as follows

    SELECT DISTINCT ZipCode FROM tblTableName

    You will need to change the code to suit your table and field name.
    Allan

  4. #4
    Join Date
    Aug 2006
    Posts
    9

    Many thx!

    That did the trick! I really need to get in the DBA world.

  5. #5
    Join Date
    May 2006
    Posts
    407
    Which "that" did the trick? Two separate solutions were presented.

  6. #6
    Join Date
    Aug 2006
    Posts
    9

    Distinct

    Golferguy,
    I used the distinct command and it created a table that produced the unique zips.

    I appreciate your help on this one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •