Les Mizzell writes: > I've got two tables > > A. Branches > B. Employees > > I need to loop through the "Branches" table, and count the number of > matching employees from the employees table.. > > Branch A > 13 employees > Branch B > 14 employees > > RecordCount won't work here, will it? What's the best way to do this? >
Assuming there's a relationship between the two tables (employeeID (?)), you can just do an inner join: SELECT * FROM BranchA INNER JOIN BranchB ON BranchA.employeeID = BranchB.employeeID; then you can do a recordCount :) hth, charlie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com