Focal Point
[SOLVED]Field containing &

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

December 22, 2015, 11:08 AM
Junaid
[SOLVED]Field containing &
Need syntax help with this
WHERE INDEX_CODE CONTAINS 'S&P 500';

This keeps asking me INPUT P.

Please help this Novice user.
Thanks

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
December 22, 2015, 11:22 AM
Prince Joseph
Webfocus is thinking that &P is an amper variable so it is looking for a value for it. One way to get around this is to do this:

-SET &P = '&' | 'P';

Hopefully that works.


Webfocus 8, All Outputs

December 22, 2015, 12:04 PM
Squatch
This might work also:

WHERE INDEX_CODE CONTAINS 'S&|P 500';


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
December 22, 2015, 01:08 PM
Junaid
Yes, both options worked.
Thanks guys.


WebFOCUS 8
Windows, All Outputs
December 22, 2015, 04:08 PM
Waz
FYI

I would characterise the pipe character like an escape character for the amper character, but is used after it.


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!