Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
How to have Business Date ?
As in if i apply Today()-1 and if there is Saturday or Sunday the report will be blank. So in this case if i run report on Monday Today()-1 should provide report of Friday.
Please help how to achieve the above.
Thanks.
Use the function NetworkDays()
Can you give example for network days? I want holidays on Friday and Sunday.
It exists the function networkdays() ... maybe it can be useful ...
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 timestamps.
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
You also might be able to use:
firstworkdate(end_date, no_of_workdays {, holiday} )
Returns the latest starting date to achieve number_of_workdays (Monday-Friday) ending no later than end_date taking into account any optionally listed holidays. End_date and holiday should be valid dates or timestamps.
Examples:
firstworkdate ('2007-03-01', 9) returns '2007-02-19'
firstworkdate ('2006-12-31', 8, '2006-12-25', '2006-12-26') returns '2006-12-18'
lastworkdate(start_date, no_of_workdays {, holiday})
Returns the earliest ending date to achieve number_of_workdays (Monday-Friday) if starting at start_date taking into account any optionally listed holidays. Start_date and holiday should be valid dates or timestamps.
Examples:
lastworkdate ('2007-02-19', 9) returns '2007-03-01'
lastworkdate ('2006-12-18', 8, '2006-12-25', '2006-12-26') returns '2006-12-29'
Thanks for reply.
If i want Friday and Saturday as working days and Sunday as Holiday. So how can i achieve ?
If i want Friday and Saturday as holidays days and Sunday-Monday as Working days. So how can i achieve ?