Simple IF statement returning wrong results.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello and thank you in advance for your time.
I'm running a simple IF Statement
IF [Days 1]<='30' Then 'Pass'
Else 'Fail' ENDIF
But in the results its showing 7 , 9 days etc., as a fail. Then in some cases it's retuning the correct result and all the fails are returning the correct results.
any ideas what I'm doing wrong?
Thanks again
Solved! Go to Solution.
- Labels:
- Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@CRogers22 to Number([Days 1]) <= 30 Then 'Pass' Else 'Fail' EndIf
7 and 9 are less than 30 which is correct as per your logic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@CRogers22
if Yous days 1 is a numeric filed there is no need of adding '30' and this is causing error
update your formula
IF [Days 1]<=30 Then 'Pass'
Else 'Fail' ENDIF
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
When I use this formula I get a Parse Error at Char (18); Invalid type in operator <=.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If [Days 1] is a string, then use this....
IF ToNumber([Days 1])<=30 Then 'Pass'
Else 'Fail' ENDIF
If it is a numeric value, use this....
IF [Days 1]<=30 Then 'Pass'
Else 'Fail' ENDIF