SELECT * FROM ( SELECT TT.TRANSDATE, TT.TAXAMOUNTCUR , TT.TAXORIGIN , TT.VOUCHER , TT.TAXITEMGROUP , TT.TAXCODE , TT.SOURCEBASEAMOUNTCUR , TT.SOURCETAXAMOUNTCUR , TTGJAERIVA.TAXTRANSRELATIONSHIP , TTGJAERIVA.GENERALJOURNALACCOUNTENTRY , TTGJAERIVA.LEDGERDIMENSION , GJAERIVA.TEXT , GJAERIVA.LEDGERDIMENSION AS LEDGERDIMENSIONGAE , GJAERIVA.POSTINGTYPE FROM TAXTRANS TT INNER MERGE JOIN TAXTRANSGENERALJOURNALACCOUNTENTRY TTGJAERIVA ON TTGJAERIVA.TAXTRANS = TT.RECID INNER MERGE JOIN GENERALJOURNALACCOUNTENTRY GJAERIVA ON TTGJAERIVA.GENERALJOURNALACCOUNTENTRY = GJAERIVA.RECID AND GJAERIVA.POSTINGTYPE IN (14, 236, 71, 41) AND TT.TRANSDATE >= '2016-10-10' WHERE (TT.TAXORIGIN <> 11 AND TT.TRANSDATE BETWEEN '2017-10-10' AND '2017-12-15') OR (TT.TAXORIGIN = 11) -- AND TT.TRANSDATE BETWEEN '2017-10-20' AND '2017-10-25') ) AS T LEFT MERGE JOIN ( SELECT VOUCHER , SOURCERECID , TAXITEMGROUP , TAXCODE , GENERALJOURNALACCOUNTENTRY , TAXAMOUNT , TAXAMOUNTCUR FROM TT ) TTRISR ON T.VOUCHER = TTRISR.VOUCHER AND T.SOURCERECID = TTRISR.SOURCERECID AND T.TAXITEMGROUP = TTRISR.TAXITEMGROUP AND (TTRISR.TAXCODE LIKE 'R%') AND TTRISR.GENERALJOURNALACCOUNTENTRY = TTGJAE.GENERALJOURNALACCOUNTENTRY
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
This award recognizes a member of Experts Exchange who has made outstanding contributions to the community within their first year as an expert. The Rookie of the Year is awarded to a new expert who has the highest number of quality contributions.