Link to home
Start Free TrialLog in
Avatar of nobile00
nobile00

asked on

Crystal Report Calculating Shift Work hours

In a Crystal report I need to calculate Shift Work Hours pulling form a CRM.

One Shift is Monday Wednesday and Thursday 7 am to 7pm I need to calculate the worked hours for those days for each month.  In the CRM there are day fields to use not sure how to go about this any suggestions greatly appreciated.
Avatar of Mike McCracken
Mike McCracken

What have you tried?

It should be a simple as
DateDiff('h',{ShiftStartTime},{ShiftEndTime})

If that doesn't work what data do you have for the employee work

mlmcc
Avatar of nobile00

ASKER

I tried something like that but need to get certain days per shift.  I need to calculate hours worked for Monday Wed. and Thurs. so it will show time spent for each service for each employee within the day for the Month

There are a lot of fields available day fields, date fields etc.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tried If DayofWeek ({wh_time_subitem.date_worked})IN (crSunday, crWednesday, crThursday) then
Calculation Monday, Wednesday, Thursday

Getting an error it wants a ) after crSunday  tried a few things but still get the error
You need to use [ ] not ( ) around the list
The SQUARE brackets [ ]  are used for sets of values

mlmcc
I tried DayofWeek ({wh_time_subitem.date_worked})IN [crSunday, crWednesday, crThursday] and it returns FALSE.

What I am trying to do is pull all the employees hours for all days but and then calculate their available hours from their shift to calculate their utilization for the week… which is Sunday – Saturday.  One shift is Sunday Wed and Thursday hope that makes sense.
Where did you try DayOfWeek?

 If you put that formula in the detail section and got False for every record, that would imply that none of the records had dates on those days.  The test itself is really simple.  crSunday, etc. are just pre-defined names in CR that correspond to the values for days of the week -- 1 for Sunday, 2 for Monday, etc.

 James
Sorry for the delay in responding.