QRYSLT in OPNQRYF

50 pts.
Tags:
AS/400
OPNQRYF
QRYSLT
How to write the qry in OPNQRYF for below condition All are char fields Field Names are F1,F2 & F3 F1 = 'ABC' or F1 BCD and F2 = 'OPQ' F3 = 'ghi' Please provide me sample code to write QRYSLT Expression

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

I usually build a char variable, &QRYSLT and then use it in the OpnQryf
CHGVAR &QRYSLT
(‘(F1 *EQ ‘‘ABC’’ *or F1 *EQ ’’BCD’’) *and F2 *EQ ‘‘OPQ’’ *and F3 *EQ ‘‘ghi’’’)

Since this is a character string deliminated by quotes, quotes that need to remain in the string are represented by double quotes.
Phil

————————-
Not double quotes, I don’t remember if they work but double single quotes.. and at the end of the phrase ghi”’ is a triple single quote.
Phil

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Questions do you want (F1 = 'ABC' or F1='BCD') and F2 = 'OPQ' and F3 = 'ghi' or F1 = 'ABC' or (F1='BCD' and F2 = 'OPQ') and F3 = 'ghi' or something else Are the values ABC, BCD, OPQ and ghi constants or are they stored in variables? Phil
    51,355 pointsBadges:
    report
  • Msharbudeen
    It first one (F1 = ‘ABC’ or F1=’BCD’) and F2 = ‘OPQ’ and F3 = ‘ghi’ all the values are constants
    50 pointsBadges:
    report
  • Msharbudeen
    Hi Philp, Thank you for immediate help.
    50 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following