Recursive script for multiple entries w/consecutive dates
Posted: Tue Oct 26, 2004 5:45 pm
I have two tables: one table stores employee leave requests (pk_id,fk_emp_id, fk_attendance, start_date,end_date,station,comments
the second table stores daily assignments(pk_id,fk_emp_id,date,station, fk_attendance,comments)
I want a script that will change the employee's attendance in the daily assignment table based on what is enterd in the employee leave table.
NOTE: Employees will already be entered on the daily assignments table as PRESENT(attendance) at their assigned stations. Station is NONE when employee is out.
For example,
An entry on the leave table for Sue Smith on jury duty from 10/26/04 to 10/29/04 should result in her records in the daily assignments table to be updated to
ID,NAME,DATE,STATION,ATTENDANCE
347,Sue Smith,10/26/04,NONE,Jury Duty
348,Sue Smith,10/27/04,NONE,Jury Duty
349,Sue Smith,10/28/04,NONE,Jury Duty
350,Sue Smith,10/29/04,NONE,Jury Duty[/code]
Thanks in advance,
abe nash
the second table stores daily assignments(pk_id,fk_emp_id,date,station, fk_attendance,comments)
I want a script that will change the employee's attendance in the daily assignment table based on what is enterd in the employee leave table.
NOTE: Employees will already be entered on the daily assignments table as PRESENT(attendance) at their assigned stations. Station is NONE when employee is out.
For example,
An entry on the leave table for Sue Smith on jury duty from 10/26/04 to 10/29/04 should result in her records in the daily assignments table to be updated to
ID,NAME,DATE,STATION,ATTENDANCE
347,Sue Smith,10/26/04,NONE,Jury Duty
348,Sue Smith,10/27/04,NONE,Jury Duty
349,Sue Smith,10/28/04,NONE,Jury Duty
350,Sue Smith,10/29/04,NONE,Jury Duty[/code]
Thanks in advance,
abe nash