Count Number of Employees in Payroll Jnl.

I have searched the forum and see several threads on counters, but none seem to work in this instance. I would like to modify the Payroll Jnl Test Report to count the number of employees who have entries in the current Payroll Jnl. Any ideas on how to do this are appreciated.

Counter := 0; PayrollJnlLine2.RESET; PayrollJnlLine2.SETCURRENTKEY(“Journal Template Name”,“Journal Batch Name”,“Employee No.”); PayrollJnlLine2.SETRANGE(“Journal Template Name”,“Payroll Journal Batch”.“Journal Template Name”); PayrollJnlLine2.SETRANGE(“Journal Batch Name”,“Payroll Journal Batch”.Name); IF PayrollJnlLine2.FIND(’-’) THEN REPEAT PayrollJnlLine2.SETRANGE(“Employee No.”,PayrollJnlLine2.“Employee No.”); IF PayrollJnlLine2.FIND(’+’) THEN Counter += 1; PayrollJnlLine2.SETRANGE(“Employee No.”); UNTIL PayrollJnlLine2.NEXT = 0;

Thanks Naveen, Works perfectly[;)]