
Anonymous Community User asked a question.
Date and 2 calculations with Syntax errors
I have an App in that app I'm using 3 fields to track assets and know when they have hit their 10 year or older mark. -The First field(Date of Manufacture) is a date field using only a "start" date( no times or end date) -The second field(DoM Years) is a calculation field, which is to calculate years the asset has been in service, the calculation I am using is var d1 = moment(@Date of Manufacture); var d2 = moment(); var result = d2.diff(d1, 'years'); result; -The third field that I'm having trouble with is an if then statement I need the third field to reference the second field's calculation and if the years are equal to or greater than 10 years mark it as 'yes' and if it is less than 10 years mark it as 'no' this is what my brain types it as but the syntax is wrong {if (@DoM Years >= '10' "yes")else 'no'}