Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calculating Hours Post Reply Post New Topic
Author Message
K. Milligan
Newbie
Newbie


Joined: 15 Jun 2009
Online Status: Offline
Posts: 5
Quote K. Milligan Replybullet Topic: Calculating Hours
     Posted: 29 Jun 2009 at 11:41am

Apparently the two whole days of Crystal Reports Class I took wasn't quite enough for me to figure out my latest problem.

Background - I'm extracting data from our time keeping db in order to put together a resonably readable payroll report.
 
I have 3 tables I'm working with:
 
punch.employeeid - links to employee.fullname
punch.depthours - accumulated hours worked per punch pair
punch.nonworked - string that states whether vacation, personal or sick time was taken
 
Problem:  punch.depthours includes all worked hours AND non worked hours.  I need a formula that totals the punch.depthours and extracts punch.nonworked hours.  So that all I see is actual hours worked. 
 
Hopefully this makes sense to someone, even reading it myself, it looks very confusing....err.
 
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jun 2009 at 12:03pm
you can use a Running Total to do this as a conditional SUM of the dept.hours to exclude the rows where nonworkeed=condition
 
You can create a formula field to chaneg the depthours to exclude the items where they were not worked adn then Sum that.
 
I don't know the condition so I cannot write either formula...most likely will be something like.
if {punch.nonworked}="present" then {punch.depthours} else 0
 
or maybe
 
if isnull({punch.nonworked}) then {punch.depthours} else 0
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum