Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If record selection

Status
Not open for further replies.

ShortyA

MIS
Feb 20, 2002
363
CH
Hi,
I have the following text in my record selection but it is excluding all other BEGQUEUECD cases that don't fulfil these criteria. How can I ensure that it includes those that don't have BEGQUEUECDs as below ?

Thanks - Alec
(
if {W20U999S.BEGQUEUECD}="EFFDATE" then
(
{W20U999S.ENDQUEUECD} in ["END","NEXTDAY","AUTH","BAT"]
)
else if {W20U999S.BEGQUEUECD}="GEN" then
(
{W20U999S.ENDQUEUECD} in ["END","NEXTDAY","EFFDATE","AUTH","SUW","IUW","BAT"]
)
else if {W20U999S.BEGQUEUECD}="POSTPOL" then
(
{W20U999S.ENDQUEUECD} in ["END","NEXTDAY","AUTH","EFFDATE"]
)
)
 
I'm not sure I follow what you're doing.

The selection criteria are where you exclude the records you definitely don't want. You're trying to combine this with processing for ENDQUEUECD. I'd have thought that belonged in a formuala field.

You could also slip in an else (something) command at the end. But my rule for safe programming is to avoid complex logic and break it down into separate tests wherever possible. Madawc Williams
East Anglia
Great Britain
 
You're telling it to only bring back certain rows, yet your complaint appears to be that it's doing so?

Perhaps you should post example data and expected output, that way little is left to the imagination and interpretation.

-k

 
I think I have worked it out now.
(
{W20U999S.BEGQUEUECD}="EFFDATE" and {W20U999S.ENDQUEUECD} in ["END","NEXTDAY","AUTH","BAT"]
or
{W20U999S.BEGQUEUECD}="GEN" and {W20U999S.ENDQUEUECD} in ["END","NEXTDAY","EFFDATE","AUTH","SUW","IUW","BAT"]
or
{W20U999S.BEGQUEUECD}="POSTPOL" and {W20U999S.ENDQUEUECD} in ["END","NEXTDAY","AUTH","EFFDATE"]
or
NOT ({W20U999S.BEGQUEUECD} in ["POSTPOL", "GEN", "EFFDATE"])
)

I needed to put the NOT bit on at the end.
Thanks,
Alec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top