Solved

Crystal Report Calculating Shift Work hours

Posted on 2014-11-20
8
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 101

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 101

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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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 101

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 …
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

690 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