I need help with the syntax when writting my custom reports. Seems I'm always screwing up the ifs/ands/or commands. What manual or For Dummies book would you recommend to help me with this language?
For example: my code of-
IIF((status_desc = "Member" ) OR (status_desc = "Inactive member"), "Member", "Not a member")
is always coming back False (Not a member).
I'm not getting any members. What's a better way to state this? It veryifies clean.
Need help with syntax
Moderators: Moderators, Tech Support
-
- Posts: 320
- Joined: Sun Sep 28, 2003 5:37 pm
- Location: First Cutlerville Christian Reformed Church
- Contact:
-
- Program Development
- Posts: 463
- Joined: Fri Sep 05, 2003 3:08 pm
- Location: PowerChurch Software
- Contact:
Re: Need help with syntax
This is Visual FoxPro. The example you are showing should work, if you've spelled and cased the text correctly. To prevent loss of functionality when someone changes the case of the values you could do this:
If you need to be more exact this syntax would be used (the double equal means they need to exactly match:
Code: Select all
IIF(UPPER(status_desc) = "MEMBER" OR UPPER(status_desc) = "INACTIVE MEMBER", "Member", "Not a member")
Code: Select all
IIF(UPPER(ALLTRIM(status_desc)) == "MEMBER" OR UPPER(ALLTRIM(status_desc)) == "INACTIVE MEMBER", "Member", "Not a member")
Tracy
-
- Posts: 320
- Joined: Sun Sep 28, 2003 5:37 pm
- Location: First Cutlerville Christian Reformed Church
- Contact:
Re: Need help with syntax
Thanks, I used your syntax and now it works fine.