That's good. Glad it works for you, apologies for the confusion in missing that from the example.
Cheers,
Karl.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Smith, Mike
Sent: Tuesday, September 22, 2020 11:31 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] RE: wrkqry vs sql result difference
Ahh,
I did not add the case to my order by. Looks like that will do it.
Thanks
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Karl Haggart
Sent: Tuesday, September 22, 2020 2:26 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] RE: wrkqry vs sql result difference
Hi Mike,
Apologies, you will also need to cater for the case in the Order By clause. Did you do that?
Thanks,
Karl.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Smith, Mike
Sent: Tuesday, September 22, 2020 10:25 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] RE: wrkqry vs sql result difference
I just gave this a try, with the same results.
I also used the rtvqmqry command to get the select statement, which also gave the same results.
Thanks
MIke
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Karl Haggart
Sent: Tuesday, September 22, 2020 12:25 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] RE: wrkqry vs sql result difference
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://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,aRFN2H-hPvouvKVzArp-Vn2CSU64nZxEg30aoM4WGeoqrdMnM7WFkLuV6ZTh14lvc5oxxj1wGFnwjnIV-6YDBse_I3JzmK8pOO_8Mn9U-YJOGjwA-5o,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,O6eRZ-BwPHbImSfa-hPoRNZ_oAuG48YW1G1kpfIXuJd4IHe5XmzrPXmLHdRDd7P4BaSTsf_Ps-_O1JcJvzgDemSD8inRFM3SGCVvAt3zVj0C6XnVwS-3SA,,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,HiIjlKLr5AxuAyDybq5Fq1ad2GL_KlKcvs-cn2YyFbcqRVU7eTefTLVH5qWMDMNGYWqyFfyHiLIbTKSc0DXS164uDBLFSoRJ7uOG8PqpMtVla3A5qLtATt6ZxTzl&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,mGy5Fo5-TMqiK8YDnaAhVLICRewhklS-Rri35ctOzLhw3oGNPq7Ef1LlFUPy2CCmbpbVPuol4daw9h3aYwOsnmbh9KbDVULfIzSpdQeINo9U1mc,&typo=1
--
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://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,fqG6NFFj0goOYRJPfzh68b1GR-o2FTo3b8DPJv0uGA8m3nXK0_ugdFx9bmadIWeeeNGMyYC01nCXI7O58YSfRR1dlyORoqS84uys9esyw_qy7OI9I6KwKDU,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,HIQ1rOhNZP2KfoIJAkbMgLG31G1Kx4csF8snz5CWQN9h8_UgvSOJwVWzsBB03AyCRhsaaBHErcpukbktiO3dV8J1YMsjb-GT3VoRKyo6H-ALW38,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,WU76E8eYnLAeH0w_Q3oj4lERWEItjahBWKqiO_RJw7fYM4X94W7nlQaz_CEAVpwYJZbx57ihyjXDvcdvmsdx3yELKyATLx5ue-RDhHsMf0eqsUj2FCdufJLy&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,YbyozQijqTrMI0FLJobQBacmDbaoWPJaaY2NWtxzyYKpJhdap99SZGrq-t6fE0VXZid1a3q10CaymQwugLKCmQnSO7QHlK8K9hCdPmM_Z9zP8Zsyl6ARRw,,&typo=1
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://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,MRaQxe08cpuwKv8_tJDBqiS2ijZNZ8kDb6Yy9tf6DBeaHdyr00aPRdY2fPQNHGNnA8nuojVtkLc3gGgwn3-vS62FwhYMqKtX2590RdA_KySgogSXnTudrjJZi-Y,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,hkcQzRZKVcDu_4llCV6W3ItYVbSEY3igAdO6qJzNvj7eDsZ1oN_faZ_jX5gmIEsw9oJhQ-bqdwb7cznCf3A26HYUWBlB-2I0Xv6ZCQr5_Ou4wbKbUQ,,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,PBUEzlRtirEWOzPpNgk0tO3n1qregGUxnQIRMlTQRNYTknU29kzY9NEPiVuvFCoVTWXYIJxG9ZzG3_5VcS8sWvJZrm-CxBGPJuJKtJs5PA,,&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,mFbgCy-sJMBMBhmy5XuMWLwCT3_8T91bRtEaGda5gmrIwIXeMLpJDiSXsgqKWeZNH6ocRFIt7buYwbW9_4CstjR96i-30uo4tipv_WVWeNO5FlFbxvjUNBbw7aQ,&typo=1
--
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://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,q4ouIqZzbnTRTkh7jxeyVXuRD3wiI4o0JNhbsEuxm-KCryxHph03gYI0ZViljxuNQzM3ED7jdh3Q9T6mjbIE1PIWK2qIQQGBy3u_4bCIKxO3nk4uVi6bico,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,4sgWoE6Flv_gbykAv2obxBo8zhboG6iqfsDeXJPav2_Gba12CjTjYuB4xVmjQtZsFpLn1RxPIs9jFmDsJGQPIm4EunYYf-6iC-q2saqlPPyCBv8Gl8hIMWM,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,UgDY-OGzxHCpdje9qV_a-f7sDU73qz57rIqS_dbdcOmXJIdnvm1ZrI3Jj0QyWI_gTSPLRWBvXbaLaz9in62-Y5SzP6rn4HK1J5Cy1jaiyASzDrqdNVOnP6X-6SpI&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,35wBFhpXT2IHWQ6lxZ9RPdd-EpRXeB2H-NIHp-sVPmBj7G-oFwJA-qRVX8POhh2TxVuMgYuUvtd15yeDiGaXEyl6r_KpNEHOrBloZY0E3J8EGCfV&typo=1
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.