I want the formula to make the enddate the end of the fiscal year if the end date goes past the fiscal year end date. But when I try to run this formula it highlights the last end and says that a boolean is required here. I want it to return a date, not a boolean.
//@{enddate}
datevar end = {Command.ENDDATE};
datevar start = {Command.STARTDATE};
numbervar yearstart = datepart("yyyy",start);
numbervar yearend = datepart("yyyy", end);
datevar fiscalyearend = dateserial(yearstart + 1, 3, 31);
if yearend > yearstart then
(
if end > fiscalyearend then
end = fiscalyearend
)
else
end
//@{enddate}
datevar end = {Command.ENDDATE};
datevar start = {Command.STARTDATE};
numbervar yearstart = datepart("yyyy",start);
numbervar yearend = datepart("yyyy", end);
datevar fiscalyearend = dateserial(yearstart + 1, 3, 31);
if yearend > yearstart then
(
if end > fiscalyearend then
end = fiscalyearend
)
else
end