Thanks Dave and Ernst I almost have it except for one last detail after calculating the individuals “Years of service” I just print them out if they are in
1:-
5.00,10.00,15.00,20.00,25.00,30.00 (I am using a decimal here) but what I was hoping to do is either accumulate each user into a text string and I.E.
5yearsString := 5yearsString + username +" " + userno + " " +years + “\n”; not sure how to inset the newline this is psuedo code.
then accumulate line after line of 5 10 … year employees then print that big string out for each year catagory
2:-
the second and better way Id like to do it is promt the user for a years of service value (5.00,10.00,15.00…30.00)
then just print out that years employees
any ideas on how to do that?
code so far
using Employee
Employee Assignments
employee - onAfterGetRecord()
Days := 0;
Years := 0;
oldYears := 0;
ServiceYears := 0;
sections
Employee Assignment Body (1) OnPreSection()
EndDate := “Employee Assignment”.“End Date”;
StartDate := “Employee Assignment”.“Contract Start Date”;
EffDate := “Employee Assignment”.“Effective Date”;
IF FORMAT(EndDate) = ‘’ THEN EndDate := TODAY;
IF FORMAT(EffDate) = ‘’ THEN EffDate := EndDate;
IF FORMAT(StartDate) = ‘’ THEN StartDate := EffDate;
IF Earliest > StartDate THEN Earliest := StartDate;
IF Latest < EndDate THEN Latest := EndDate;
IF FORMAT(Latest) = ‘’ THEN Latest := EndDate;
IF FORMAT(Earliest) = ‘’ THEN Earliest := StartDate;
ServiceYears := ROUND(( Latest - Earliest )/365,1,’=’);
CurrAssYears := ROUND(( EndDate - StartDate )/365);
Years := ROUND(( EndDate - StartDate )/365,1,’=’) + oldYears;
Days := (EndDate - StartDate) + Days;
oldYears := Years;
testyears:= ROUND((EndDate - StartDate)/365);
CurrReport.SHOWOUTPUT(FALSE);
then in the Employee Assignment Footer (2) I output name emp # and years of service (calculated both ways)
I calculate years of service 2 ways for hr
-one by summing assignment time per each assignment
-two subtracting the earliest assignment date from the latest assignment date
turns out calculating “Years of Service” is NOT like calculating critical mass (no big reaction if you over estimate Years of service) so I give it to them both was
and they can decide which one is valid