Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to make at the time of loading a date variable is set to Day - 2 working days, anyone know how to subtract 2 days excluding Saturday and Sunday
in script? Thank you.
LET varTwoDaysBack = FirstWorkDate(Today(),3);
don't forget to end the statement with a semicolon
=
firstworkdate(today(),3)Hi,
You can also try NetWorkDays(). To quote from the manual ....
"networkdays (start:date, end_date {, holiday})
Returns the number of working days (Monday- Friday) between and including start_date and end_
date taking into account any optionally listed holidays. All parameters should be valid dates or times-tamps.
Examples:
networkdays ('2007-02-19', '2007-03-01') returns 9
networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8"
but how do I put this date in a variable in the script, Set and Let not work ...
LET varTwoDaysBack = FirstWorkDate(Today(),3);
don't forget to end the statement with a semicolon
I need to put single quotes before and after the filter to date, I do this in the script + or &?
I solve this,
chr(39) & FirstWorkDate(Today(),3) & chr(39);
thanks.