AS400 Qry – Is there a way to trick qry into treating blanks as null?

5 pts.
Tags:
AS/400
QRY
Query
The data I need to sort on is in either field A or B depending on the transaction type. It could be accomplished by using the "value" expression if qry would consider a blank field as null. Any ideas?

Answer Wiki

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

Hello,

This website may be able to help you in your Query…

http://www.itjungle.com/mpo/mpo060503-story01.html

TPinky

One way to do this is a CASE expression.
Beware: not a CASE <i>statement </i>but a CASE <i>expression</i>.
You might have to write it in the ORDER BY clause.

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
  • Gilly400
    Hi, Afraid you can't use CASE in Query. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • TomLiotta
    AS/400 queries aren't limited to the Query/400 product. SQL queries are also possible and CASE works fine with them. Or queries might be executed through various APIs and essentially all HLLs. If the question doesn't specify that a particular method of query is required, then any answer is valid. Tom
    125,585 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