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

Need help with Reccount ? 1

Status
Not open for further replies.

hwaclh

Programmer
Aug 15, 2002
7
US
I have a database that collects manufacturing incidents. I have hundreds of incidents per machine. I need to create a report where I know the amount of incidents per machine. The Reccount function gives me total amount of records in the database. Is there an easy way to know the amount of records per group?

I already started programming a loop where I create a View for each machine and count the records in that view and then I store them in an array but I thought it might be an easier way.

Any help would be appreciated.

thanks
 
Can you not just use a query to count and group the incidents per machine. Not sure how the database is laid out but something like:

SELECT Machine, Count(Machine) AS CountOfIncidents
FROM Incidents
GROUP BY Machine

Returns something like:

Machine CountOfIncidents
Mach_1 3
Mach_2 1
Mach_3 5
 

I guess this is exactly what I was looking for Kevin.

I have to go a try it but will the Count(machine) give me the number of records for
each different machine, right?

If the answer is yes, which I guess it is then you did wonderful.

Really appreciate the help.
 
Hi hwalch

Count(FieldName) will count the records as per your grouping. If you can not get it to work then maybe try posting a description of how your database is laid out and I or someone from this site should be able to help you further.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top