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



I have a SQLRPGLE program that I need to add a JDE file to with a JDE
Julian date. How do I call a RPG III date conversion routine inside a SQL
JOIN statement? Is it possible?

Here's my working SQL

C/EXEC SQL
C+
C+ INSERT INTO FA203WA
C+ SELECT a.dprfno, a.dcusno, b.inpinv, b.inninv, b.invamt,
C+ a.prefno, a.cusno, c.inpinv, c.inninv, c.invamt,
C+ sum(a.price*a.shdqy)
C+ FROM hdcinvpr a
C+ join sc308wa b on a.dinvno = b.inpinv
C+ and a.dcusno = b.incuno
C+ join sc308wa c on a.invno = c.inpinv
C+ and a.cusno = c.incuno
C+ where b.inacod in (select plant from sc005pr)
C+ and c.inacod in (select plant from sc005pr)
C+ group by a.prefno, a.CUSNO, b.inpinv, b.inninv, b.invamt,
C+ a.dprfno, a.dcusno, c.inpinv, c.inninv, c.invamt
C+ order by a.prefno, a.CUSNO, b.inpinv, b.inninv, b.invamt,
C+ a.dprfno, a.dcusno, c.inpinv, c.inninv, c.invamt
C+
C/END-EXEC

can I add this join?
C/EXEC SQL
C+
C+ INSERT INTO FA203WA
C+ SELECT a.dprfno, a.dcusno, b.inpinv, b.inninv, d.rpag,
C+ a.prefno, a.cusno, c.inpinv, c.inninv, e.rpag,
C+ sum(a.price*a.shdqy)
C+ FROM hdcinvpr a
C+ join sc308wa b on a.dinvno = b.inpinv
C+ and a.dcusno = b.incuno
C+ join F0311 d on a.dinvno = d.rpdoc
C+ and d.rpdctm = ' '
C+ and (call 'x0028' %sst(a.dprfno:5:10),
C+ parm2,
C+ parm3,
C+ parm4,
C+ parm5,
C+ parm6,
C+ parm7)
C+ join sc308wa c on a.invno = c.inpinv
C+ and a.cusno = c.incuno
C+ join F0311 e on a.invno = d.rpdoc
C+ and d.rpdctm = ' '
C+ and (call 'x0028' %sst(a.prefno:5:10),
C+ parm2,
C+ parm3,
C+ parm4,
C+ parm5,
C+ parm6,
C+ parm7)
C+ where b.inacod in (select plant from sc005pr)
C+ and c.inacod in (select plant from sc005pr)
C+ group by a.prefno, a.CUSNO, b.inpinv, b.inninv, b.invamt,
C+ a.dprfno, a.dcusno, c.inpinv, c.inninv, c.invamt
C+ order by a.prefno, a.CUSNO, b.inpinv, b.inninv, b.invamt,
C+ a.dprfno, a.dcusno, c.inpinv, c.inninv, c.invamt
C+
C/END-EXEC

V5R4

Regards,

Guy

-------------------------------------------------------------------------------
The information contained in and transmitted with this e-mail may be
privileged, proprietary, confidential and protected from disclosure. No
privilege is hereby intended to be waived. This e-mail is intended only
for the person to whom it is addressed. If you are not the intended
recipient/addressee, any use of the e-mail and/or its contents, including,
but not limited to, dissemination, distribution or copying is strictly
prohibited and may be unlawful, and you must not take any action in
reliance on it. If you receive this e-mail in error, please immediately
notify the sender and delete the original message and any copies of it
from your computer system. We deny any liability for damages resulting
from the use of this e-mail by the unintended recipient, including the
recipient in error.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.