Solved

Crystal Report Calculating Shift Work hours

Posted on 2014-11-20
8
396 Views
Last Modified: 2014-12-11
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.
0
Comment
Question by:nobile00
  • 4
  • 3
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40455084
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
0
 

Author Comment

by:nobile00
ID: 40455959
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.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40456276
Does that calculate the hours you just need to select the correct days?

If you just want to select/report on those days you can use the selection like
DayOfWeek({YourDateField}) IN [crMonday, crWednesday, crThursday]

Open in new window


If you just need to change the calculation of hours then
If DayOfWeek({YourDateField}) IN [crMonday, crWednesday, crThursday] then
    Calculation for Monday, Wednesday, and Thursday
Else
    Calculation for the rest of the week

Open in new window


mlmcc
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:nobile00
ID: 40458270
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40458557
You need to use [ ] not ( ) around the list
The SQUARE brackets [ ]  are used for sets of values

mlmcc
0
 

Author Comment

by:nobile00
ID: 40463316
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.
0
 
LVL 35

Expert Comment

by:James0628
ID: 40463417
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
0
 

Author Closing Comment

by:nobile00
ID: 40495078
Sorry for the delay in responding.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question