Solved

Crystal Report Calculating Shift Work hours

Posted on 2014-11-20
8
349 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
 

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now