Yes, it is 2 characters wide.
Bonni
---
Bonni Harris
Database Analyst
Eureka College
300 E. College Avenue
Eureka, IL 61530-1500
309-467-6467
On Mon, Feb 2, 2015 at 10:39 AM, Eddie Lotter <forums_noreply@adobe.com>
Ah, that explains it. If the field is defined as char(2) then single letter codes will have a trailing space.
Try the following:
iif (FindNoCase(trim(query.ethnic_cod), "PUW") eq 0, 0, 1)
The trim() function will remove a leading or trailing space.
It is important to understand that this solution still has the problem that if you have a code of "PU" or "UW" then the statement will return 0. Which is not what you want.
If you can confirm that the ethnic_cod field has a space after the "P" or "U" or "W" then a safer algorithm would be the following:
iif(FindNoCase(query.ethnic_cod, "P ,U ,W ") eq 0, 0, 1)
Instead of stripping the space from the field I have added the space after each letter in the second string of the FindNoCase() function. I am assuming your ethnic_cod field does not use the comma character, as I'm using it as a delimiter to prevent a match with a leading space.
I am also assuming the code is not case sensitive. If it is then use the Find() function rather than the FindNoCase() function.
Do you understand the logic behind what I am showing you?