Joined: 12 Feb 2008
Location: United States
Online Status: Offline
Posts: 22
Topic: Formula for DateDiff based on 260 work days in yea Posted: 29 Apr 2010 at 8:04am
I have two formla fields that are evaluating DateBed and DateEnd to determine what date to use.
@StartDateCalc
if {EComp.EmDateBeg} <= {@DateBeg} then {@DateBeg} else {EComp.EmDateBeg}
@EndDateCalc
if {EComp.EmDateEnd} = date(0,0,0) then {@DateEnd} else if {EComp.EmDateEnd} <= {@DateEnd}then {EComp.EmDateEnd} else {@DateEnd}
I need to create a third formula that takes the difference between StartDateCalc & EndDateCalc to arrive at a number of "Worked" days, assume 5 days per week (Mon-Fri) 260 per year.
I'm familar with the DATEDIFF Function, but that uses actual days.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 30 Apr 2010 at 3:21am
the simplest formula that comes to mind is take the number of days that you have calculated...let call it d and divide by 7 to get weeks and multiple by 5 to your days...something like:
d/7*5 or (d/7)*5 if you're paranoid. This will only give an approximation as there lots of days that not worked by are part of the week...holidays primarily...
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