I have a query that has two "OR" sections in Select Records. It has been working fine. We added a 3rd "OR" and it gets "Selection error involving field CPCAAT". Pressing F1 shows the following:
Message . . . . : Selection error involving field CPCAAT.
Cause . . . . . : The query did not run because of a comparison operand
involving data from field CPCAAT (in record 0 of file CTLNPROP in HZWORK if
other than *N). The CPCAAT data is not necessarily incorrect, since the
operand could be an expression involving other fields and constants as well
as CPCAAT, or it could require some sort of conversion that could not be
performed successfully.
Pressing F10 from there:
>> wrkqry
Here's what's in Select Records:
The odd thing is, if I delete the 1st two selection groups, the 3rd one works fine by itself, but any combination of the 1st & 3rd, 2nd & 3rd, or all three, gets the error. I even tried reversing the order just for fun, but it didn't make any difference.
CURRLTV is a defined field:
However, it was already there before, and like I said, it works fine with the 3rd OR group. I suppose there could be divide-by-zero issues, but wouldn't the error then occur with the 3rd OR by itself. Any ideas?
(This is my first post, so I hope I'm on the right forum for this question)
Message . . . . : Selection error involving field CPCAAT.
Cause . . . . . : The query did not run because of a comparison operand
involving data from field CPCAAT (in record 0 of file CTLNPROP in HZWORK if
other than *N). The CPCAAT data is not necessarily incorrect, since the
operand could be an expression involving other fields and constants as well
as CPCAAT, or it could require some sort of conversion that could not be
performed successfully.
Pressing F10 from there:
>> wrkqry
Code:
Select or omit error on field CPCAAT member CTLNPROP. Select or omit error on field LMTTLN member LNMAST. Select or omit error on field CPMTG1 member CTLNPROP. Selection error involving field CPCAAT. 3 informational messages logged.
PHP Code:
LMLTYP EQ 5
AND LMAPPL EQ 'IL'
AND LMSTAT NE 'C'
AND SRTMO EQ datmo
AND SEQ180NUM LE 720
AND B1CHGFICO GE 50
OR LMLTYP EQ 5
AND LMAPPL EQ 'IL'
AND LMSTAT NE 'C'
AND SRTMO EQ datmo
AND SEQ190NUM LE 720
AND B2CHGFICO GE 50
OR LMLTYP EQ 5
AND LMAPPL EQ 'IL'
AND LMSTAT NE 'C'
AND SRTMO EQ datmo
AND CURRLTV GT 100
CURRLTV is a defined field:
Field Expression
CURRLTV (lmttln + cpmtg1)/cpcaat * 100
CURRLTV (lmttln + cpmtg1)/cpcaat * 100
(This is my first post, so I hope I'm on the right forum for this question)
Comment