count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear dear,
Can we count on more specific? I want to count only a group of the data.
for example : field "reference" : 55, 55, 22, 22, 22
so the texboxs will be "reference" as the source and the textbox as the
count to count on the source changed. the answer should be 55 = 2, 55= 2,
22= 3,22= 3,22= 3
Thanks
 
Hi,



SELECT reference, COUNT(*)
FROM myTable
GROUP BY reference



will return



55 2
22 3





Hoping it may help,
Vanderghast, Access MVP
 
Thanks Much heLP,
Can the outcome alter? For example, sometimes, like to show in as count as
an enumerated format such as 1 2 3 4 and another group 1 2 3 4 5 6 7 or an
another group 1 2 3 55, 55, 55 = 1, = 2,= 3 .
Thanks
 
Hi,


With Jet, you will need a "driver" table, like Iotas, one field, Iota,
with values from 1 to 999 (for illustration).


SELECT a.*, Iotas.Iota
FROM mySavedQuery As a INNER JOIN Iotas
ON a.theCount >= Iotas.Iota


will return the desired result (assuming mySavedQuery is:

SELECT reference, COUNT(*) As theCount
FROM myTable
GROUP BY reference





Hoping it may help,
Vanderghast, Access MVP
 
Back
Top