Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
Do you know how could I find the last workday of a month ?
Thanks for your help,
Best regards,
Jaymerry
Hello,
If it can help someone, I have find the solution (where $vMaxDay is the last day of a month) :
Lastworkdate(date(monthstart('$(vMaxDay)',-1),'YYYY-MM-DD'),NetWorkDays(date(monthstart('$(vMaxDay)',-1),'YYYY-MM-DD'),date(monthend('$(vMaxDay)',-1),'YYYY-MM-DD'))) as Last_WorkDay
Regards,
Jaymerry
Hi,
You can use function LastWorkDate (see explaination below from the reference manual):
lastworkdate( start_date, no_of_workdays {, holiday} )
Returns the earliest ending date to acheive number_of_workdays
(Monday-Friday) if starting at start_date taking into account any
optionally listed holidays. Start_date and number_of_workdays
should be valid dates or timestamps.
Example:
lastworkdate ('2007-02-19', 9) returns '2007-03-01'
lastworkdate ('2006-12-18', 8, '2006-12-25', '2006-12-26') returns
'2006-12-29'
Hello,
If it can help someone, I have find the solution (where $vMaxDay is the last day of a month) :
Lastworkdate(date(monthstart('$(vMaxDay)',-1),'YYYY-MM-DD'),NetWorkDays(date(monthstart('$(vMaxDay)',-1),'YYYY-MM-DD'),date(monthend('$(vMaxDay)',-1),'YYYY-MM-DD'))) as Last_WorkDay
Regards,
Jaymerry