× 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.



Use a UNION query and rename the fields in the SELECT so they match in both queries.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rowe, Sheri
Sent: Tuesday, February 26, 2008 4:32 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: can this be done with SQL - a record is one file or the other

Hi iSeries Guru's,



Can anyone tell me if I can do this with SQL and if so how?



I have a Vendor File APOHD and a Vendor History file APHHD. A voucher
will either be in one file or the other, not both, as once a voucher is
closed it will be in the History file. Both files contain the same
information, but have different field names.



A user wants to get the Voucher, Vendor#, Invoice# and Posting Date of a
given voucher (it needs to be a variable which I can pass), but it will
be in only one file or the other. I can't figure out how to do a
'non join' on the files.



I know I could do this with 2 separate SQL's, but was curious if it's
possible to do it with one.



I want a result that looks like this, regardless of which file has the
voucher.



Voucher Vendor Invoice Posting Date

79993 1234 456789 080228



Thanks in advance for your help!



Sheri



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.