473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need Help On How To Do Counts by Uniques

This sounds simple, so I'm sure I'm just not getting it on how to use Access. I'm using Access 2007

What I'm trying to do is get a unique count of People by ProjectName

Example of the data set

ProjectName | Person | Action
Opus | John | Piano
Violet | Mark | Violin
Violet | Mark | Guitar
Mozart | Sandy | Flute
Mozart | Mark | Violin
Mozart | Mark | Guitar

The result should look like

ProjectName | Count of People
Opus | 1
Violet | 1
Mozart | 2

Can anyone help?

Thanks

Raymon
Aug 13 '08 #1
3 1165
rsmccli
52
This sounds simple, so I'm sure I'm just not getting it on how to use Access. I'm using Access 2007

What I'm trying to do is get a unique count of People by ProjectName

Example of the data set

ProjectName | Person | Action
Opus | John | Piano
Violet | Mark | Violin
Violet | Mark | Guitar
Mozart | Sandy | Flute
Mozart | Mark | Violin
Mozart | Mark | Guitar

The result should look like

ProjectName | Count of People
Opus | 1
Violet | 1
Mozart | 2

Can anyone help?

Thanks

Raymon
You will want to create a query and use aggregate functions. If you create a query on your table(s) in the graphical query designer, right click in the bottom part and select 'Totals'. Another row of choices will appear. This one's pretty simple, so I would just fool around with the 'Group By' and 'Count' choices. It will be good practice since you are just starting out.

hth,
rsmccli
Aug 13 '08 #2
You will want to create a query and use aggregate functions. If you create a query on your table(s) in the graphical query designer, right click in the bottom part and select 'Totals'. Another row of choices will appear. This one's pretty simple, so I would just fool around with the 'Group By' and 'Count' choices. It will be good practice since you are just starting out.

hth,
rsmccli
Hi! Thanks for replying back.

Any idea on how the SQL would look like?
Aug 13 '08 #3
For the benefit of other users, I got help from someone else. It was simpler than what I thought it was.

Expand|Select|Wrap|Line Numbers
  1. SELECT ProjectName, COUNT(*) As CountOfPeople
  2. FROM (SELECT ProjectName, Person FROM tblTableName GROUP BY ProjectName, Person)
  3. GROUP BY ProjectName 
  4.  
Aug 14 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steven Bethard | last post by:
I have a list of dictionaries. Each dictionary holds counts of various 'words', e.g.: py> countdicts = I need to select dicts with the constraint that the number of each 'word' totalled...
5
by: WertmanTheMad | last post by:
Ive been playing with this for a few days and thought I might thow it out for seggestions. I have Several Queries that need counts returned The Queries are Mutually Exclusive meaning whatever...
1
by: Randy K | last post by:
I have a table with some 35000 records and I need some help sorting it out. The goal is to get counts of failures modes oraganized by serial number. the table is set up roughly like this. s/n ...
5
by: Theresa Hancock via AccessMonster.com | last post by:
I have an Excel table I need to import into Access. The name is entered into one field "Name". I'd like to have two fields in Access, FirstName and LastName. How do I do this. -- Message posted...
1
by: Trinix | last post by:
This program I'm working on is asking for an "Array of counters," What is that?
2
by: Zak McGregor | last post by:
Hi all I have a table, for simplicity's sake containing one field, called unid. for example, select unid, oid from table gives me something like this: unid | oid ---------+---------
1
by: mskapek | last post by:
I need some advise on how to best create an Access 2002 report from multiple "total" queries, each which result in 3- 5 values that I need displayed on my report. Most of the queries do simple...
9
by: lilchiko1286 | last post by:
I am taking an intro to C++ course in college. I was assigned a project that i must complete on MS Visual Studio in where I am supposed to prompt the user for a name and then a letter and output...
2
by: Superfreak31 | last post by:
Hello All, I need help with a SQL Query. I have a table with a StateId and PartNumber. I'll be joining some tables to get the state name from the StateId and Part Description from the Part...
3
sueb
by: sueb | last post by:
I have a database that stores information about surgeries performed at the hospital where I work. One of the pieces of data is the date of each surgery. I need to make a chart that counts these...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.