Grouping and counting question

M

Mark

Having a hard time with this. I want to count how many unique Nest_To_Cont I
have for a particular Zone and Time.

I’m using something like this, but it is counting duplicates in the
Nest_to_Cont field, thus giving me more then expected.

Select Distinct Zone, Time, Count(nest_to_cont) AS Total
Group by, Zone, Time

What am I doing wrong?
 
K

KARL DEWEY

Try using these two queries --
Mark_tbMain --
SELECT tbMain.SHIP_ZONE, DatePart("h",[DTIMECRE]) AS [Work Hour],
tbMain.NEST_TO_CONT
FROM tbMain
GROUP BY tbMain.SHIP_ZONE, DatePart("h",[DTIMECRE]), tbMain.NEST_TO_CONT;

SELECT Mark_tbMain.SHIP_ZONE, Mark_tbMain.[Work Hour],
Count(Mark_tbMain.NEST_TO_CONT) AS CountOfNEST_TO_CONT
FROM Mark_tbMain
GROUP BY Mark_tbMain.SHIP_ZONE, Mark_tbMain.[Work Hour];
 

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