Quantcast
Channel: SCN: Message List - Reporting and Printing
Viewing all articles
Browse latest Browse all 2719

Exclude A/P Credit Memo from this Query

$
0
0

Hello All,

 

i am trying to figure out to exclude A/P Invoice that it was already Credit Memo with my existing Query

 

SELECT
max(T0.DocDate) as 'Date',
max(T1.CardName) as 'Vendor Name',
max(T0.Address) as 'Vendor Address',
count(T0.DocNum) as 'No. of Invoices',
max(T1.LicTradNum) as 'TIN No.',
sum(T0.BaseAmnt) as 'Base Amount',
sum(T0.VatSum) as 'Input Tax',
max(T1.ECVatGroup ) as 'TaxCode',
max(T2.WTCode) as 'WtaxCode'
FROM OPCH T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode 
left join PCH5 T2 on T0.DocEntry = T2.AbsEntry
WHERE T0.DocDate BETWEEN '[%0]' and '[%1]' and T0.VatSum <> 0 
GROUP BY T1.CardCode

Please help mew revise my Query.

 

this is connected with my previous question How to Identify A/P Invoice that was Credit Memo  but i cannot figure out how to incorporate PCH1.TargetEntry

 

Please Help.

 

Thank You.

 

Fidel


Viewing all articles
Browse latest Browse all 2719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>