Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / June 2006

Tip: Looking for answers? Try searching our database.

COUNTING the instances of various values in a Single Field.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kev100 - 30 Jun 2006 18:08 GMT
This seems like it should be really simple....I'm still learning Access and
can't quite get it.  I've searched for the process, but those I've found all
seem slightly different.

I've simply got a table with a few 100 records.

One of the fields in each record is CITY.

The city name could be just about anything.

I'm needing a query to produce a count of all the instances.  The end result
would, ideally, be something like:

Town                    Total Instances
Columbus               345
Brownsville                53
Greenville                110
Middlesville                89
etc...

Would this just be some various of SUM() ?...other?

Thanks very much.
MGFoster - 30 Jun 2006 18:42 GMT
> This seems like it should be really simple....I'm still learning Access and
> can't quite get it.  I've searched for the process, but those I've found all
[quoted text clipped - 17 lines]
>
> Would this just be some various of SUM() ?...other?

If all your criteria is listed in your post the query would look like
this:

SELECT Town, Count(*) As Total_Instances
FROM table_name
GROUP BY Town

Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Conan Kelly - 30 Jun 2006 21:07 GMT
In my experience with Access (2002), it doesn't like to count *'s

If MGFoster's query doesn't work for you, the try it like this:

SELECT Town, Count(Town) As Total_Instances
FROM table_name
GROUP BY Town

Hope this helps,

Conan Kelly

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
[quoted text clipped - 27 lines]
>>
>> Would this just be some various of SUM() ?...other?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.