Manage Learn to apply best practices and optimize your operations.

Simple Code To Get The No.Of Workingdays Between Two Dates Excluding Weekends& Holidays

1.Create a Holiday Form with a field named "Holiday".

2. Create all the Holiday documents using this form.

3. Create a view "New" to select the holiday as first column.

4."ApprovedDate"(Time Type) is a Field in the Main Form which contains a date
when the document is Approved.

5.Put the Following code in a Button.

Example: Put the ApprovedDate as [29/06/2000] and create a Holiday(04/07/2000)
falling between today(05/07/2000) and ApprovedDate.The resulting cycle time
would be 3 days.(1Sat,1Sun day&One Holiday--- Total 3 days are
Substracted from the Total Days of 6 Days.
d:=@DbColumn("";"":"";"New";1);
x:=(@Today-ApprovedDate)/86400;
Noholidays := @Elements(@Keywords(d;@Text((@TextToTime(@Explode(
@TextToTime(@Text(ApprovedDate)+ " - " + @Text(@Today))))))));
NoOfSatSun := @Elements(@Keywords("1":"7";@Text(@Weekday(@TextToTime(@Explode(
@TextToTime(@Text(ApprovedDate)+ " - " + @Text(@Today))))))));

y:=x-NoOfSatSun;
p:=y-Noholidays;

r:=@If(@IsError(p);"";p);
@Prompt([OK];"Reminder";@Text(p))

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close