Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What could be wrong with the following expression:
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', If([Med Aid] = 'PRIVATE', 'OUT-OF-POCKET',[Med Aid])) as [Payment Type]
Regards.
Chris
Or even this:
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', If(WildMatch([Med Aid], '*PRIVATE*'), 'OUT-OF-POCKET',[Med Aid])) as [Payment Type]
Looks right to me. It isn't working?
May be, just may be PRIVATE isn't upper case in your data? You can force it to be Upper and see if it resolves
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', If(Upper([Med Aid]) = 'PRIVATE', 'OUT-OF-POCKET',[Med Aid])) as [Payment Type]
The field name could be misspelled or have the wrong case. Same for the value 'PRIVATE'. Perhaps you need to check for if(UPPER([Med Aid]) = 'PRIVATE'
perhaps can be the upper case, you'll may use the function wildmatch, or in fact, upper, like Sunny and Gysbert recommended to you.
For performance, You should convert [Med Aid] with autonumber, and compare number is more efficient.
Hi,
Try Like this,
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', If(Trim([Med Aid]) = 'PRIVATE', 'OUT-OF-POCKET',[Med Aid])) as [Payment Type]
Check whether your Fields mentioned are exact ones or not as Suggested by Sunny.
HTH,
Hirish
The database screen shoot is as follows:
It is in upper case
Many thanks please see thread above
Any trailing spaces?
Have you looked at Hirish V suggestion? Trim([Med Aid]) before checking it for PRIVATE?