You need a loop, to go through each record until the last record, and then exit loop, halt script
wait, I take that back, the more I think about it you may actually need a nested loop here with an IF statement.
Little more specific: You need to write your entire script for what you need to do first. (i.e. take an employee's name and grab all records related to that employee, and spit it out in an excel sheet.)
That will require a loop to start with the first employee, run the procedures, and then go to the next employee and run them again, etc until the last employee is reached.
However, depending on what all kind of records you need to grab related to that employee you may need a loop to search through all your records and find them all. Thus, you end up with a loop statement inside a loop statement.
Hope that cleared that up instead of confuse you more... LOL
I know I need a loop what i'm not sure of is from respect of which table. My thinking was a loop, that starts in the customer table, grabs the employee in that table, does a find in customers table based on that name, exports results to excel and goes on to the next employee, however I had no luck with that strategy so i'm missing something in behind or something.
It's hard to tell what you might be missing without knowing more about your system. This basic strategy, though using an employee ID number instead of a name is a better approach, should work for you.