Hello, i'm making a report about employee information and I got stuck at their age information: I have one record that contains their work ID, names, birth date, first employment and dismissal dates. Second record contains their work ID, names, work position, first employment and dismissal date. Everything i try I just cannot separate them by age to their represented work position here is the code I use at the moment:
record2.RESET;
record2.SETFILTER(record2."workposition", '%1', workposition.code);
IF inputdate<>empty THEN
BEGIN
record1.SETFILTER(record1."!Dismissal Date", '%1|%2..',empty,CALCDATE('+1D',inputdate));
record1.SETFILTER(record1."First Employment Date", '..%1',inputdate);
END
ELSE
record1.SETFILTER(record1."!Dismissal Date", '%1',empty);
record1.SETFILTER(record1."Birth Date",'%1..%2',CALCDATE('-30T' , inputdate),CALCDATE('-18T' , inputdate));
A1830:=record1.COUNT;
record1.SETFILTER(record1."Birth Date",'%1..%2',CALCDATE('-40T' , inputdate),CALCDATE('-30T+1D' , inputdate));
A3040:=record1.COUNT;
record1.SETFILTER(record1."Birth Date",'%1..%2',CALCDATE('-50T' , inputdate),CALCDATE('-40T+1D' , inputdate));
A4050:=record1.COUNT;
record1.SETFILTER(record1."Birth Date",'%1..%2',CALCDATE('-60T' , inputdate),CALCDATE('-50T+1D' , inputdate));
A5060:=record1.COUNT;
record1.SETFILTER(record1."Birth Date",'..%1',CALCDATE('-60T+1D' , inputdate));
A60:=record1.COUNT;
record2.RESET;
I get a total of all workers in the company of that age for example the correct numbers for 18-30 should be aaa = 2, bbb = 3, ccc = 1, total: 6. The 40 is as i said a total of all employee's in the company of 18-30 age.