SOLVED
Malformed If Statement
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
CRogers22
8 - Asteroid
‎07-15-2024
12:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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'
Solved! Go to Solution.
Labels:
- Labels:
- Error Message
4 REPLIES 4
binuacs
21 - Polaris
‎07-15-2024
12:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
IIF DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')
‎07-15-2024
12:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you. Now I'm getting Unknown variable "IIF"
binuacs
21 - Polaris
‎07-15-2024
01:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
put a bracket after IIF
updated the formula
IIF(DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')
LindonB
11 - Bolide
‎07-15-2024
02:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
