Manage Learn to apply best practices and optimize your operations.

Days Between Dates

Two formulas that I often use in views to calculate the days between two dates. One formula is used for calendar days. The other excludes weekends.

 REM "Calendar Days Between 2 Dates"; EndDate := @Today; StartDate := AnyDateField; diffDays := (EndDate - StartDate)/86400 + 0; @If(@IsError(diffDays); 0; diffDays) REM "Days Between 2 Dates Excluding Weekends"; EndDate := @Today; StartDate := AnyDateField; diffDays := (EndDate - StartDate)/86400 + 0; strtDay := @Modulo(@Weekday(StartDate); 7); endDay := @Modulo(@Weekday(EndDate); 7); result := @Integer((diffDays - endDay + strtDay - 8)*5/7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay); @If(@IsError(result); 0; result)

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...