Welcome Guest, Not a member yet? Register   Sign In
How to Combine Staff Data?
#1

I have two tables named "Staff" and "Events." To create a view, I aim to retrieve all Staff records and, for each Staff record, obtain the SUM of the related amount fields in the Events table, connected by Staffid.

My goal is to have both the data from each Staff record and the corresponding SUM total in the same array. However, I'm facing a challenge in achieving this.

As of now, I've managed to retrieve all the Staff data and used a foreach loop to call a method that calculates the SUM total. Yet, I'm uncertain about how to merge or combine the two sets of data effectively.

I would greatly appreciate any guidance or insights on how to accomplish this task. How can I successfully combine the Staff data with the corresponding SUM total from the Events table?

Thank you in advance for your assistance!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB