Selecting Ranges

  • Thread starter Thread starter RFJ
  • Start date Start date
R

RFJ

I want to create a query that counts the number of occurences in a range.
The actual example is from a salary survey that I'm designing and I want to
summarise the number of people employed by each company. eg

Employed Count

<10 6
11 - 50 11
51 - 100 32
101 - 500 11
501+ 9


TIA
 
Hi,



Get the ranges in a table:


Ranges ' table name
Low High 'fields name
0 10
10 50
50 100
100 500
500 10000 'data



========
SELECT a.Low, a.High, COUNT(*)
FROM myTable As b INNER JOIN Ranges As a
ON b.salary>=a.low AND b.salary<a.high
GROUP BY a.Low, a.High
========





Hoping it may help,
Vanderghast, Access MVP
 
Back
Top