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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not sure how to do this? 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi all i have query which am trying to show from table "sheet"

the field am using is hr

what i would like to do is count then number of records who have results below:

<50
between 51 and 100
>100

this is what i got but am not sure its right?

SELECT Count(Sheet4.HR) AS [HR<51], Count(Sheet4.HR) AS [HR51-100], Count(Sheet4.HR) AS HR100
FROM Sheet4
HAVING (((Count(Sheet4.HR))<51) AND ((Count(Sheet4.HR)) Between 51 And 100) AND ((Count(Sheet4.HR))>100));


many thanks farouq

 
Perhaps:

Code:
SELECT Sum(IIf([Sheet4].[HR]<51,1,0)) AS [HR<51], Sum(IIf([Sheet4].[HR]>50 And [Sheet4].[HR]<101,1,0)) AS [HR51-100], Sum(IIf([Sheet4].[HR]>100,1,0)) AS HR100
FROM Sheet4;
 
Cheer Remou thats exactly i was looking for :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top