cancel
Showing results for 
Search instead for 
Did you mean: 

Malformed If Statement

SOLVED
Highlighted
CRogers22
Asteroid

Malformed If Statement

I'm trying to create an IF statement to tell me if there is >= 3 days between dates. Can someone tell me what I'm doing wrong?


if [Application Date]-[Disclosure Date]>=3 then 'Pass' else 'Fail'

4 REPLIES 4
Highlighted
CRogers22
Asteroid

Malformed If Statement

I'm trying to create an IF statement to tell me if there is >= 3 days between dates. Can someone tell me what I'm doing wrong?


if [Application Date]-[Disclosure Date]>=3 then 'Pass' else 'Fail'

binu_acs
Polaris

Re: Malformed If Statement

@CRogers22 

IIF DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')

Re: Malformed If Statement

Thank you. Now I'm getting Unknown variable "IIF"

binu_acs
Polaris

Re: Malformed If Statement

put a bracket after IIF

updated the formula

IIF(DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')

 

LindonB
11 - Bolide

Re: Malformed If Statement

Hi there. First, just add a select tool first to make sure both fields are numeric. If so, your expression is fine but needs "ENDIF" at the end. It won't work otherwise. 

 

if [Application Date]-[Disclosure Date]>=3 then 'Pass' else 'Fail' endif