I have the following Arcade expression to calculate the difference between two dates
var DateRec = $feature.DATEAPRECV
var DateVal =$feature.DATEAPVAL
var ValDays = DateDiff(DateVal, DateRec, 'Days');
return ValDays + " day";
What i have tried to do is add in an IF clause to change the day to days if ValDays => 2 but get errors regard parenthesis
var DateRec = $feature.DATEAPRECV
var DateVal =$feature.DATEAPVAL
var ValDays = DateDiff(DateVal, DateRec, 'Days');
if (ValDays = 1)
return ValDays + " day";
else if (ValDays => 2)
return ValDays + " days";
The error is
Invalid expression.
Error on line 4.
Close parenthesis expected
Can anyone please explain what is wrong??