|
Hi Group,
I have an sql statement, which this group helped me with, and is working
great, but now my boss wants another field, containing a description,
entered in the resulting file and I can't figure out how to do it with
SQL. To get this field I need to add two files not in this query, ITMST
and ZGRPDSCP.
SELECT a.pdvnno, a.pdcono, a.pdorid, a.pdlnsq, a.pditno, a.pdlnst,
a.pdorqt, a.pdqrcd, b.tdtqrc, b.tdstas, A.PDORQT - A.PDQRCD as
OutStng
FROM aplus2ftx/podet A left outer join aplus2ftx/pordt B on
a.pdorid = b.tdpono and a.pdcono = b.tdcono and a.pdlnsq = b.tdlnsq
and a.pditno = b.tditno and b.tdstas <> 'C'
WHERE a.pdlnst = 'O'
ORDER BY 2,1
File ITMST, has item # (imitno) and Item class (imitcl) fields.
File ZGRPDSCP has item class # (grcode) and Item class description
(grdesc) fields.
I need to join podet.pditno to itmst.imitno to get the imitcl value,
then join itmst.imitcl to zgrpdscp.grcode to get the grdesc field.
Thanks 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 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.