the problem may be
(Date of Interim Sanction) - (Date of Referral to Regulatory Body)
This will evaluate to 1-1, 1-0, 0-1 or 0-0. Please try it without the parentheses:
Date of Interim Sanction - Date of Referral to Regulatory Body
Also, I believe that if you just add on to your previous threads on this topic, it would be easier for folks to follow along and help.
my bad, I had that burned into my brain at some point.
The parentheses aren't the problem.
Try this calc:
dREF = "10/10/2016" // substitute your field name here
; dINT = "17/10/2016" // and here
; dFIN = "24/10/2016" // and here
; result = If ( not IsEmpty ( dINT ) ; GetAsDate ( dFIN ) - GetAsDate ( dINT ) ; GetAsDate ( dFIN ) - GetAsDate ( dREF ) )
result & " days"
The result line will give you the period between referral and interim if there is an interim date, but otherwise will give the period between referral and final date. If the data you feed in is in date fields you will not need to use GetAsDate, but it will make no difference if you do.