select empId, ; year, ; month, ; DayNr, ; Leave, ; 0 AS Total ; from MyTable ; union all ; select emp_id, ; year, ; month, ; 99 as DayNr, ; Leave, ; count(*) AS Total ; from MyTable ; GROUP BY 1, 2, 3, 5 ; order by 1,2,3,4,5 ; INTO CURSOR MyCursorWhat you can do now is add the fields to the detail band. Create a Data Group with the expression of "DayNr = 99", without the quotes. This will give you an opportunity to use the Group Header band to create some white space and add some column titles that you want printed just before the totals for an employee.