Simple Counting Query Question... But it's killing me.

B

Brendan

For topic sake, I will keep it simple. I have a query that derives its data
from a table. This query has a two fields (vBusinessName and vDateTime).
What I am trying to do is count the amount of unique fields for vBusinessName
and do it in the query so I can then sort them (in rank) for output to a
report.

When I use the count function, all I get is "1" as and answer in each row.
There has to be a way that I can total each address that we have gone to.

Thanks,

Brendan
 
M

Mio

Make two queries:

Q1
SELECT DISTINCT Data.vBusinessName
FROM Data;

Q2
SELECT Count(NoDubs.vBusinessName) AS CountOfvBusinessName
FROM NoDubs;

Hope this helps,

Mika
 
K

KARL DEWEY

This query has a two fields (vBusinessName and vDateTime).
Leave vDateTime out as it is making each record unique.
 
J

John W. Vinson

For topic sake, I will keep it simple. I have a query that derives its data
from a table. This query has a two fields (vBusinessName and vDateTime).
What I am trying to do is count the amount of unique fields for vBusinessName
and do it in the query so I can then sort them (in rank) for output to a
report.

When I use the count function, all I get is "1" as and answer in each row.
There has to be a way that I can total each address that we have gone to.

Thanks,

Brendan

If you're using the vDateTime field as a criterion to select records, uncheck
its Show checkbox in the query grid and change the default "Group By" on the
totals row to Where.
 
B

Brendan

Problem Solved and thanks to all who helped.

Created two fields in my query from my table. Both fields auto named as
vbusinessname. In the first field (column), everything stays the same. In
the second column, the vbusinessname becomes a "Count" option.

You guys were right about the vDateTime field forcing each value to be
unique and thus not allowing a true count. It s been a while and its amazing
what you forget about the simplest things.

Brendan
 

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