Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a total time from clocking in/out information

Status
Not open for further replies.

KenziC

Technical User
Sep 8, 2011
5
US
Hello!
I am creating a report to show the percent of how much time the shop guys are clocked into a job vs how much time the guys are CLOCK IN.

More detail: You get here in the morning and CLOCK IN. Then you clock in/clock out of several jobs. Then you CLOCK OUT for lunch. Then CLOCK IN for the afternoon. Clock in/out of several jobs. Then CLOCK OUT for the day.

I'm sorry it is confusing.

I have a field that automatically adds the clock in/clock out of jobs hours. So that portion is taken care of.

Ive had to do a sub report regarding the CLOCK IN/CLOCK OUT but it is just showing me times. I would like to subtract the times and have a grand total showing x employee was CLOCKED IN __ hrs __ mins __ seconds today.


Once I get this information, I would like to create a percentage based on clocked in/out of jobs vs CLOCKED IN time. Is there a way to do this through the sub report?

Thank you for any and all help. It is much appreciated!

Kenzi
"Programmers are tools for converting caffeine into code."
 
DateDiff includes an option to find the difference in hours or minutes or seconds between two date / time fields. That's stage 1.

As you describe it, I think you'd need to create a formula field that checks whether each record was a CLOCK IN or a CLOCK OUT, and then does a calclation using a value from the previous record (the PREVIOUS command). But not for the first record for an employee, and something special for the last. These can be identified by grouping by employee, and then having two counts per employee:
- a 'Running Total' that will be 1 for the first record in the group and not complete till the last record in the group
- a Summary Total that has the group total all along.

If you're not already familiar with Crystal's automated totals, see FAQ767-6524.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top