|
George, I couldn't get your first query to run at all until I modified it a little as follows: SELECT APVNDR, APINV, AINVDT, ADUEDT, APGLDT, APCINA, APCDAV, LHYEAR, LHPERD, HHTRNO, HHJNEN, LHJNLN, CRSG01, CRSG02, CRSG03, CRSG04, CRSG05, LHDRAM, LHCRAM, LHLSTS FROM APH LEFT OUTER JOIN GHHJ01 ON APH.APVNDR = GHHJ01.XRHVND AND APH.APINV = GHHJ01.XRINV LEFT OUTER JOIN GLH ON GHHJ01.XRLDGR = GLH.LHLDGR AND GHHJ01.XRBOOK = GLH.LHBOOK AND GHHJ01.XRYEAR = GLH.LHYEAR AND GHHJ01.XRPERD = GLH.LHPERD AND GHHJ01.XRJNEN = GLH.LHJNEN INNER JOIN GCR ON GLH.LHLDGR = GCR.CRLDGR AND GLH.LHIAN = GCR.CRIAN WHERE APGLDT between 19990900 AND 19990999 AND XRBEOR=8 ORDER BY APVNDR, APINV, HHJNEN, LHJNLN I didn't even attempt the second one but I'm sure it would work similarly. The only major problem I found is that the query is extremely sloooow. I would definitely suggest creating a logical view on this and I would not order it unnecessarily. --Paul Holstein iWork Software, L.L.C. ----Original Message Follows---- From: "George Sagen" <gsagen@primesourcetech.com> Reply-To: BPCS-L@midrange.com To: <BPCS-L@midrange.com> Subject: RE: AMH AML APH APL GHH GLH The key to joining subsystem transactions to the G/L is the GXR table. These scripts assume you have a 5 segment COA. As a return favor please let me know if you find any weaknesses in these scripts: Accounts Payable Invoice Distribution to the G/L: SELECT APH.APVNDR, APH.APINV, APH.AINVDT, APH.ADUEDT, APH.APGLDT, APH.APCINA, APH.APCDAV, GLH.LHYEAR, GLH.LHPERD, GHHJ01.HHTRNO, GHHJ01.HHJNEN, GLH.LHJNLN, GCR.CRSG01, GCR.CRSG02, GCR.CRSG03, GCR.CRSG04, GCR.CRSG05, GLH.LHDRAM, GLH.LHCRAM, GLH.LHLSTS FROM ((APH LEFT OUTER JOIN GHHJ01 ON (APH.APVNDR = GHHJ01.XRHVND) AND (APH.APINV = GHHJ01.XRINV) LEFT OUTER JOIN GLH ON (GHHJ01.XRLDGR = GLH.LHLDGR) AND (GHHJ01.XRBOOK = GLH.LHBOOK) AND (GHHJ01.XRYEAR = GLH.LHYEAR) AND (GHHJ01.XRPERD = GLH.LHPERD) AND (GHHJ01.XRJNEN = GLH.LHJNEN) INNER JOIN S102PHTM.BPCSFMMP.GCR GCR ON (GLH.LHLDGR = GCR.CRLDGR) AND (GLH.LHIAN = GCR.CRIAN)) WHERE (APH.APGLDT >= <Low Date>) AND (APH.APGLDT <= <High Date>) AND (GXR.XRBEOR = 8) ORDER BY APH.APVNDR, APH.APINV, GHHJ01.HHJNEN, GLH.LHJNLN Accounts Payable Cash Distribution to the G/L: SELECT AML.AMLBNK, AML.AMLTYP, AML.AMLREF, AML.AMLSUB, AML.AMLLIN, AML.AMLIVN, AML.AMLINV, AML.AMLPDA, GLH.LHYEAR, GLH.LHPERD, GHHJ01.HHTRNO, GHHJ01.HHJNEN, GLH.LHJNLN, GCR.CRSG01, GCR.CRSG02, GCR.CRSG03, GCR.CRSG04, GCR.CRSG05, GLH.LHDRAM, GLH.LHCRAM, GLH.LHLSTS FROM ((AML LEFT OUTER JOIN GHHJ01 ON (AML.AMLBNK = GHHJ01.XRBNK) AND (AML.AMLTYP = GHHJ01.XRTYP) AND (AML.AMLREF = GHHJ01.XRREF) AND (AML.AMLSUB = GHHJ01.XRSUB) AND (AML.AMLLIN = GHHJ01.XRLLIN) LEFT OUTER JOIN GLH ON (GHHJ01.XRLDGR = GLH.LHLDGR) AND (GHHJ01.XRBOOK = GLH.LHBOOK) AND (GHHJ01.XRYEAR = GLH.LHYEAR) AND (GHHJ01.XRPERD = GLH.LHPERD) AND (GHHJ01.XRJNEN = GLH.LHJNEN) INNER JOIN S102PHTM.BPCSFMMP.GCR GCR ON (GLH.LHLDGR = GCR.CRLDGR) AND (GLH.LHIAN = GCR.CRIAN)) WHERE (AML.AMLPDA >= <Low Date>) AND (AML.AMLPDA <= <High Date>) AND (GXR.XRBEOR = 9) ORDER BY AML.AMLBNK, AML.AMLREF, AML.AMLLIN, GHHJ01.HHJNEN, GLH.LHJNLN Best o' luck. George Sagen CPIM, CNE PrimeSource Technologies, Inc. A Metamor Worldwide Company gsagen@primesourcetech.com http://www.primesourcetech.com (801)360-6360 Mobile and VM +--- | This is the BPCS Users Mailing List! | To submit a new message, send your mail to BPCS-L@midrange.com. | To subscribe to this list send email to BPCS-L-SUB@midrange.com. | To unsubscribe from this list send email to BPCS-L-UNSUB@midrange.com. | Questions should be directed to the list owner: dasmussen@aol.com +--- ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com +--- | This is the BPCS Users Mailing List! | To submit a new message, send your mail to BPCS-L@midrange.com. | To subscribe to this list send email to BPCS-L-SUB@midrange.com. | To unsubscribe from this list send email to BPCS-L-UNSUB@midrange.com. | Questions should be directed to the list owner: dasmussen@aol.com +---
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.