Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I'm not able to find a the LastWorkDate and FirstWorkDate functions excluding only Sundays (and not Saturdays).
Is there something like that?
If not, I've tried to write the function:
Function FirstWorkDay(StartDate, Direction, NofDays)
FinalDate = StartDate
Counter = 0
Do While Counter<= NofDays
If Direction= "P" Then
FinalDate= DateAdd("d", -1, FinalDate)
Else
FinalDate= DateAdd("d", 1, FinalDate)
End If
If Weekday(FinalDate) <> 7 Then
Counter= Counter+ 1
End If
Loop
FirstWorkDay= FinalDate
End Function
What's wrong?
Thank you.
N.
What are you going to achieve here?
Just assume, if your script like below from that which values you are going to get
Load weekday, date where weekday <> 'Sun';
Load weekday(date) as weekday, date;
Load date(mindate + iterno() - 1) as date
While date(mindate+iterno()-1) <= maxdate;
Load makedate(2017)as mindate,
Now() as maxdate
Autogenerate 1;