August 21, 2013, 05:07 PM
Josh KCOMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED??
(FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED
Is there a way around this?
What's causing the error is I'm trying to pass in a value like
' 2311'
to check against a field that is of type A12.
WHERE TLMMCU EQ &BRANCH -* throws the error
WHERE TLMMCU EQ ' 2311' -* works, but I need the users to be able to choose the value from a dropdown
August 21, 2013, 05:29 PM
WazSo the field TLMMCU is A12.
Does the variable &BRANCH contain
"' 2311'"
or
" 2311"
If it does not contain single quotes, then use:
WHERE TLMMCU EQ '&BRANCH'
August 22, 2013, 04:41 AM
TwanetteHi
quote:
If it does not contain single quotes, then use:WHERE TLMMCU EQ '&BRANCH'
... and an alternative to the above is to use
WHERE TLMMCU EQ &BRANCH.QUOTEDSTRING
August 22, 2013, 04:21 PM
Josh KThanks guys. I finally got it to work with this:
TLMMCU EQ ' &BRANCH'
I thought I tried that already and it didn't work, but I guess not because now its working.
August 22, 2013, 04:47 PM
WazYour field has leading spaces ?
August 22, 2013, 04:55 PM
susannahuse IF instead of WHERE when comparing a field to a constant
IF makes the assumption that whatever you're comparing to is a contstant.
WHERE does the opposite,
so it needs the quotes, either as Twanette does it or as Waz does, but i echo Waz... your alpha field is really right adjusted? wicked wierd. you might want to DEFINE that issue away with a
TLMMCU/An = LJUST(...
then your filtering will be easier