Q:

Trying to do a Case statement in Powerbuilder

Just trying to do a simple case function in powerbuild.
I have  a table 
client_notes
A!, B!, C!
case(client_notes when '%A!%' then 'Cash1' else "Cash2")
It compiles OK but when I run it, it says Cash2.
Shouldn't it say Cash1?

A:

What's the context here?  Is this in PowerScript or in a datawindow expression, or in the SQL source of the datawindow?
And what version/build of PB are you using?
What it should "say" [sic] all depends on the value of "client_notes" at runtime.  It will only return the string 'Cash1' when the value of client_notes is exactly equal to the string '%A!%'.
What set of data are you running this against?  Show some sample data.
-Paul Horan-

