I believe that this is an exclude join. You want to see everything in
the primary file that doesn't exist in the secondary. You key it as:
Select *
From Primary exclude join Secondary on
Primary field = Secondary field
I'm not 100% sure if I've spelled the join correctly, but in essence you
are doing a type 3 Query/400 join.
-----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.