Need Help with IF Statement

Hello Everyone,

I need help with a IF Statement I need to change the Yes or No field to read TRUE or FALSE instead. (see my code below)

The check syntax says it is good but fails when tested. (See Below)
image

Thanks in Advance.

Miguel

Try this
(case when x then y else z end)

1 Like

Or if you want to use if, you have to use the SQL version. The “Yes” or “No” is actually stored as a 1 or 0 in the field.

iif(JobOper.JobComplete=1,"True", "False")
1 Like

Hello Nate,

I am on E9 (Progress Database) and I tried your example with the same error. If you have any suggestions I would appreciate it.

Thank you.

Miguel

The IIF() function Nate suggests is only available in MS SQL Server 2012 and newer, but it’s really just syntactical sugar for the standard case/when statement. Jason’s on the right track.

You want case when JobOper.JobComplete = 1 then 'TRUE' else 'FALSE' end

2 Likes

@RC2020 It has been a long time since ABL for most of us as you can see from the replies.

I found this from an old KB that I always referred to in those days. I did not see many else clauses in my old code, but they did seem to have periods behind them. I don’t have a running 9 system anymore, but googling ABL progress 4GL IF then else will get you some ideas.

BAQ Code Library.p (15.6 KB)

If String(JobOper.JobComplete) = ‘No’ Then ‘FALSE’ Else “”