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

How do I Search for multiple instances 1

Status
Not open for further replies.

Trowser

IS-IT--Management
Dec 16, 2002
125
GB
Hi guys I have a table that stores all the hardware that users have on site, some of these users have more than one piece of hardware like multiple machines etc

Now all the users machines are referanced to them by thier payroll number for example

ID (autonumber)(key) - Payroll - Machine - Asset Number

so someone with a payroll number 6363 could have 4 machines and someone else with say payroll of 1658 could only have one machine

I would like to have a query that will return all the payroll numbers of the people that have more than one machine how would I go about this?
 
Go into the query screen and select Payroll and eg ID. Then turn the query into a Sum query. Now group by Payroll and count ID. Under ID put >1. The SQL for this should say something like count id group by payroll having countofId > 1.

 
That worked a treat thanks alot now I have the payrolls I can get the users names :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top