Forum Discussion

VladGorre's avatar
VladGorre
Qrew Member
5 years ago

workdayadd gives a sunday as result

Hi
My WorkdayAdd formula is returning a Sunday?

Fields:
Start Date = date field
Duration Days = numeric
End Date = date field

First End Date formula - this gave error "expecting workdate but found date"
WorkdayAdd([Start Date],[Duration Days])

So I cast the StartDate to a workday - this gave error "expecting date but found workdate":
WorkdayAdd(ToWorkDate([Start Date]),[Duration Days])

So I cast the result to a date
ToDate(WorkdayAdd(ToWorkDate([Start Date]),[Duration Days]))

Now when I calculate dates the answer is NOT a work day.
Start Date = Oct 1st 2019 (Tuesday)
Duration Days = 5
End Date = Oct 6th 2019 (Sunday)

I cannot find a field type that is workdate so that I can make a field always a workdate and not need to cast.
Is it possible?
How can I force a date field to be a workdate - both for formula and for manual entry fields?

If I always need to cast, why is the formula returning a Sunday?

Just in case it is relevant, all dates are in DD-MM-YYYY format.

What am I missing?
Thanks

------------------------------
Vlad Gorre
------------------------------