Business Days Between 2 Dates - In LotusScript

I currently need to calculate the number of business between 2 dates, but in LotusScript. I know I can get the difference between 2 dates in ls, but unlike formula, there doesn’t seem to be any @BusinessDays equivalent :frowning:

All I really need shortterm is to check if a date is 3 business days (ie not Saturday or Sunday) BEFORE today.

So, today being 10/Jan/08, a date that would meet my criteria would be 7/Jan/08. That’s fine because 7th is a

Any help would be great because the 7th is a Monday, however, if today was the 9/Jan/08 then 3 working days before would be 4/Jan/08

It’s probably very straight forward, and I can get it right in my head, I just can’t get my head round the lotus script logic.

Thanks

Subject: Business Days Between 2 Dates - In LotusScript

you could try using the Evaluate method of NotesSession class.

Subject: Business Days Between 2 Dates - In LotusScript

Mili, that’s exactly it! Just put together a simple little funtion here, which gives me what I want

Function GetBusinessHours(StartDate As NotesDateTime, EndDate As NotesDateTime) As Variant

Dim SDate As String

Dim EDate As String

SDate = StartDate.DateOnly

EDate = EndDate.DateOnly

Dim Formula As Variant

Formula = |@BusinessDays([| & SDate & |];[| & EDate & |]; 1:7)|

GetBusinessHours=Evaluate(Formula)

End Function