Count How Many of X are in Field A

G

Guest

I admit, I don't use Access much, so I need some simple steps in the following:

Lets say there is a Table with a Field called "Fruit"
I need a report that will tell me what Fruits and are in Fruit and how many
of each.

That is, I don't know what is in Fruit (could be Apple, Orange, Kiwi) and I
need a report that will without me knowing what Fruit there are output:

Fruit: Apple 4
Fruit: Orange 3
Fruit: Kiwi 6

Thoughts of how to do this? Much appreciated.
 
K

Ken Snell \(MVP\)

Use a query similar to this:

SELECT Fruit, Count([Fruit])
FROM YourTableName
GROUP BY Fruit
ORDER BY Fruit;
 
G

Guest

SELECT Study, Count([Study])
FROM 'Patient Information - Secure'
GROUP BY Study
ORDER BY Study;

I tried this and I got "Syntax error in query. Incomplete query clause."

Thoughts,


Ken Snell (MVP) said:
Use a query similar to this:

SELECT Fruit, Count([Fruit])
FROM YourTableName
GROUP BY Fruit
ORDER BY Fruit;

--

Ken Snell
<MS ACCESS MVP>

HODHOUTEX said:
I admit, I don't use Access much, so I need some simple steps in the
following:

Lets say there is a Table with a Field called "Fruit"
I need a report that will tell me what Fruits and are in Fruit and how
many
of each.

That is, I don't know what is in Fruit (could be Apple, Orange, Kiwi) and
I
need a report that will without me knowing what Fruit there are output:

Fruit: Apple 4
Fruit: Orange 3
Fruit: Kiwi 6

Thoughts of how to do this? Much appreciated.
 
K

Ken Snell \(MVP\)

Don't use quotes for the table name -- use [ ] instead:

SELECT Study, Count([Study])
FROM [Patient Information - Secure]
GROUP BY Study
ORDER BY Study;

--

Ken Snell
<MS ACCESS MVP>


HODHOUTEX said:
SELECT Study, Count([Study])
FROM 'Patient Information - Secure'
GROUP BY Study
ORDER BY Study;

I tried this and I got "Syntax error in query. Incomplete query clause."

Thoughts,


Ken Snell (MVP) said:
Use a query similar to this:

SELECT Fruit, Count([Fruit])
FROM YourTableName
GROUP BY Fruit
ORDER BY Fruit;

--

Ken Snell
<MS ACCESS MVP>

HODHOUTEX said:
I admit, I don't use Access much, so I need some simple steps in the
following:

Lets say there is a Table with a Field called "Fruit"
I need a report that will tell me what Fruits and are in Fruit and how
many
of each.

That is, I don't know what is in Fruit (could be Apple, Orange, Kiwi)
and
I
need a report that will without me knowing what Fruit there are output:

Fruit: Apple 4
Fruit: Orange 3
Fruit: Kiwi 6

Thoughts of how to do this? Much appreciated.
 
G

Guest

Thank you, this works great!

Ken Snell (MVP) said:
Don't use quotes for the table name -- use [ ] instead:

SELECT Study, Count([Study])
FROM [Patient Information - Secure]
GROUP BY Study
ORDER BY Study;

--

Ken Snell
<MS ACCESS MVP>


HODHOUTEX said:
SELECT Study, Count([Study])
FROM 'Patient Information - Secure'
GROUP BY Study
ORDER BY Study;

I tried this and I got "Syntax error in query. Incomplete query clause."

Thoughts,


Ken Snell (MVP) said:
Use a query similar to this:

SELECT Fruit, Count([Fruit])
FROM YourTableName
GROUP BY Fruit
ORDER BY Fruit;

--

Ken Snell
<MS ACCESS MVP>

I admit, I don't use Access much, so I need some simple steps in the
following:

Lets say there is a Table with a Field called "Fruit"
I need a report that will tell me what Fruits and are in Fruit and how
many
of each.

That is, I don't know what is in Fruit (could be Apple, Orange, Kiwi)
and
I
need a report that will without me knowing what Fruit there are output:

Fruit: Apple 4
Fruit: Orange 3
Fruit: Kiwi 6

Thoughts of how to do this? Much appreciated.
 

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