Table: tbltimeentry
Fields: workdate, EmployeeID, Jobnumber, COR (Y/N), Phase, Activity Code, Units, Pay ID (0,1: RT,OT),PerDiemAmount
Append Query needs looks at all fields above and say for an employee and if the COR field in the record is Yes and the units in the record are >= 5, write a new record in table "tbltimeentry": workdate, EmployeeID, Jobnumber, COR (Y/N), Phase, Activity Code, Units= "1", Pay ID="201" (PerDiem), PerDiemAmount
If the query looks at the records for an employee and COR=No, then I need the hours to follow the jobnumber, phase, activity combo with the most units, if more than one record has the same number of units, I need it to follow the record with the phase "01", ActivityCode "1000".
Example 1 Time Entry:
Date EmpID JobNo Phs ActCode PayID Units COR
09/25/06 12345 29000 01 1000 201 8 No
09/25/06 12345 29000 01 1900 201 5 Yes
09/25/06 12345 29000 01 2010 201 1 No
In this case the entry would go to record 2 because COR is Yes.
Example 2 Time Entry:
Date EmpID JobNo Phs ActCode PayID Units COR
09/25/06 12345 29000 01 1000 201 5 No
09/25/06 12345 29000 01 1900 201 5 No
09/25/06 12345 29000 01 2010 201 1 No
In this case, the entry would go to Record 1, because non have a COR=Yes and even though two records have 5 units (hours) each, it goes to the main job indicated by Phase "01", ActivityCode "1000"
Example 3 Time Entry:
Date EmpID JobNo Phs ActCode PayID Units COR
09/25/06 12345 29000 01 1000 201 8 No
09/25/06 12345 29000 01 1900 201 5 No
09/25/06 12345 29000 01 2010 201 1 No
In this case, COR=No, and units are not the same for any records, so entry would follow record 1 because it has the most hours.
Confused enough?
Thanks, Bailey11