Focal Point
COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED??

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5497069236

August 21, 2013, 05:07 PM
Josh K
COMPARISON 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



WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
August 21, 2013, 05:29 PM
Waz
So 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'


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 22, 2013, 04:41 AM
Twanette
Hi
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



WebFOCUS 8.2.06 mostly Windows Server
August 22, 2013, 04:21 PM
Josh K
Thanks 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.


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
August 22, 2013, 04:47 PM
Waz
Your field has leading spaces ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 22, 2013, 04:55 PM
susannah
use 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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID