Solved

Crystal Report Calculating Shift Work hours

Posted on 2014-11-20
8
373 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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