Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have one date field named 'start_date'.I need to calculate the 'due_date' using that field according to below logic:
'due_date' should be 24 hours after the 'start_date'.But the 'due_date' shouldn't be a holiday.
Here 4 cases are arising:
1.If the start date is between Mon-Thu
2.If the start date is Fri
3.If the start date is Sat
4.If the start date is Sun
Please help me guys with your precise logic.
Thanks in Advance
Use
=if(WeekDay(date(start_date)+1)='Sat',Timestamp(start_date+3),
if(WeekDay(date(start_date)+1)='Sun',Timestamp(start_date+2),
Timestamp(start_date+1)))
Not quite sure how you handle weekend.
But maybe
lastworkdate(start_date+1, 1 {, holiday})
What are your holidays? Sat and Sun?
Regards
Pratyush
It gives only date. I need time as well.Actually 'start_date' is a time-stamp field.
yes
Use
=if(WeekDay(date(start_date)+1)='Sat',Timestamp(start_date+3),
if(WeekDay(date(start_date)+1)='Sun',Timestamp(start_date+2),
Timestamp(start_date+1)))
Thanks buddy
Thanks Stefan
Maybe just
Timestamp(lastworkdate(start_date+1, 1 {, holiday})+frac(start_date))