Hello,
I'm trying to write a nested IF statement, in which the datediff is either calculated between a creation date and the completion date, or in the event that the completion date does not exist, then the creation date and the current date.
My code is as follows (however I am receiving a 'malformed if statement' error using it):
IF ISNULL([Completion by Date]) THEN
IF DateTimeDiff(DateTimeToday(), [Created on] ,'days') > 59
THEN 'Aging'
ELSEIF DateTimeDiff(DateTimeToday(), [Created on],'days') > 45
THEN 'Near Aging'
ELSE Null()
ENDIF
ELSEIF !ISNULL([Completion by Date]) THEN
IF DateTimeDiff([Completion by Date],[Created on],'days') > 59
THEN 'Aging'
ELSEIF DateTimeDiff([Completion by Date], [Created on],'days') > 45
THEN 'Near Aging'
ELSE Null()
ENDIF
Any help is greatly appreciated.
Thanks,
Alefiyah