Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Select Distinct with MS Access 1

Status
Not open for further replies.

sxp04rs

Programmer
Joined
Jul 9, 2010
Messages
9
Location
GB
Hi there,

I have a table of data similar to this:

staffId weekNumber hoursWorked
======================================
1 24 41
1 25 12
2 24 36
3 24 29
2 24 39
4 25 18

Each row represents a shift. What I need is to find out how many weeks a staff member has worked for us for. I think this would work:

SELECT COUNT(DISTINCT weekNumber) FROM tblName WHERE staffId=3

However Access does not allow COUNT DISTINCT. I have tried everything I can think of, can anyone shed any light?

Thanks!
 
SQL Select Distinct with MS Access
Your SQL code is correct as far as ANSI SQL (this forum) is concerned.
I'd post here:
Forum701

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, I have re-posted over there!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top