× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hey Karl, good to see you back in the world!

Vern

On 9/22/2020 11:24 AM, Karl Haggart wrote:
Hi Mike,

Did you try to put the " ara" section in a case statement, so something like

Select case when ARA is null then ' ' else ARA end, , acct, name
On acct = f2acct
Order by ara, acct

Thanks,
Karl.

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vernon Hamberg
Sent: Tuesday, September 22, 2020 9:15 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: wrkqry vs sql result difference

Just for fun, Mike, you might try the RTVQMQRY command to pull the SELECT statement that corresponds to what is in the QRYDFN - it won't take care of the NULL issue but might be a handy way to get the SELECT statement that will get the same results - other than how NULL is handled, where Query gives a blank, SQL gives the hyphen.

Also, when you use RTVQMQRY, you can get messages that say what incompatibilities there might be.

Cheers
Vern

On 9/22/2020 8:03 AM, Smith, Mike wrote:
I have a query that I'm trying to convert to sql.
The query has a join file(2) matched records with primary file Sorted
by area and account

There are a dozen or so records not in the secondary file however,
when the results display I get something like this

AREA Account

' ' 1
' ' 2
' ' 3
AREA1 10
AREA1 11


When I convert this to SQL I don't' get the same results, because of
the NULL values, but I can't figure out how to get the null converted
to a space in the query My results look like this

AREA Account
' ' 2
AREA1 10
AREA1 11

- 1

- 3


I have tried using select ifnull(ara, ' ') as area
And coalesce(ara, ' ') as area
But no luck

My query looks like this

Select ara, acct, name
>From file1 left outer join file2
On acct = f2acct
Order by ara, acct

Thanks

MIke



NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.