0
votes

Help! Please! I am working with a restaurant POS system using crystal reports. I am trying to modify the employee hours report and need some help. It's a very simple report that searches for each employee, then reports their hours . It sorts by date and job codes for a given time period. I rearranged the sort function so that it would list the hours according to job codes, instead of dates. Now, I need it to give me a "total hours" for each job code. Something like this:

Joe Smith Job Code: Dish 6/13 1 PM 4:30 PM 3h 30 min 6/14 2 PM 6:00 PM 4h 00 min

total hours: 7h 30 min (this is what I'm missing)

Job Code: Bus 6/13 5 PM 10:00 PM 5h 00 min 6/14 7 PM 11:30 PM 4h 30 min

total hours: 9h 30 min

The report already gives me the hours breakdown and sorts it by job code, but I need it to tell me total hours for each job code. If you PM me, I can send you screen shots of the report and the print out so it might make more sense.

Thanks!!

1
Can you explain the schema you're working with? Is the "Job Code" just the type like "Dish" or is it that big long string, "Dish 6/13 1 PM 4:30 PM 3h 30 min 6/14 2 PM 6:00 PM 4h 00 min"? - Ryan
Job Code is just a sort field "Dish, Bus, Server" that the program uses. The hours are generated by a query for a time period. It just lumped it together like that when I posted it. Basically, in the detail section of the report, it looks for a user id, then checks for the clock-ins/clock-outs for days and job codes. It used to list them all by date, but I changed it so it lists them by job code. But, if an employee has 2 or 3 job codes, I need it to total each of those seperately at the end. - Greg Stevens
And you can't just group by job code? - Ryan
I can group by job code, but it wont let me total by job code. !Report. If you look at that image of the report, you will see at the bottom it gives you the total of all hours, and the other total to the right is for just the last job code listed. I want it to give me totals for each job code. - Greg Stevens
What do you mean by "it won't let [you] group by job code"? If you're using regular summaries to get the totals, you can just put one in the group footer and CR will give you the total by job code. Or are you calculating this some other way? - Ryan

1 Answers

0
votes

After considering the evidence here and here, it looks like you just need to shuffle some elements around in the sections.

It looks like Group1 is the employee and Group2 is the job code (I have no idea what Group3 is, but it shouldn't really matter)... but according to the designer screenshot, your Group2 footer is suppressed or conditionally suppressed. That's at least partially the problem since that is where the summary you're after (The {@SumHoursJobCode} formula) needs to go.

It looks like {@SumHoursJobCode} is working as expected since it gives you the correct sum for the last jobcode group, it just needs to be moved into the Group2 footer and the footer needs to be displayed.