IF statement in AS/400 query

5 pts.
Tags:
AS/400 Query
IF statement
Can I use an if-type statement to return a different value? For example, i thought i would use define results fields to say if(lnt03=34,"advance","payoff") liek I would in excel. of course this doesn't work...

Answer Wiki

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

No, their are a number of third party products but Query/400 doesn’t do conditionals

Impossible no, not at all!!
Create three queries
— query #1 selects only records with lnt03=34 and has a result field TXTFLD value ‘advance’
it sends output to a tempfile
— query #2 selects only records with Int03 <> 34 and has a result field TXTFLD value ‘payoff’
it <ul>adds</ul> records to the file
— query #3 creates a report from the file.

Discuss This Question: 2  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
  • KPSTL
    [...] unknown wrote an interesting post today onIF statement in AS/400 queryHere’s a quick excerptNew Question Created. by KPSTL. [...]
    0 pointsBadges:
    report
  • Gilly400
    Hi, If you're doing this in SQL you can use CASE. Regards, Martin Gilbert.
    23,730 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