Skip to Content
0
Aug 30, 2017 at 07:19 AM

Items Duplication Multi times in Report

205 Views Last edit Aug 30, 2017 at 07:39 AM 2 rev

Hi experts

i had created a QUERY for Invoice Print out, 
when i run the query , same item is duplicating  2 & more times 

how can i fix it

select OINV.DocEntry, OCRD.CntctPrsn AS 'Customer Contact Person',OCPR.Position AS 'Designation',OINV.CardName AS 'Customer Name',OCPR.Address as 'Address',CRD1.Street AS 'PO Box No', 
CRD1.City AS 'City',CRD1.Country as 'Country',OCRD.Fax as 'Fax',OCRD.Phone1,OCRD.Phone2,OCRD.Cellular as 'Mobile No',OCRD.E_Mail as 'Email',OCRD.IntrntSite AS 'WebSite',OINV.DocDate as 'Postng Date',
OINV.NumAtCard as 'Ref No' ,OINV.DocCur AS 'Currency',OINV.U_Creater AS 'Doc Creater/ From',INV1.LineTotal,


Case  OINV.DocType when ('S') THEN 'Service Based'
                   when ('I') Then 'Item Based'


else 'Invalid Doc Type' end AS 'Invalid Doc Type',


INV1.Dscription as 'Description',INV1.Quantity as 'Qty',INV1.U_srv_qty AS 'Service Qty',INV1.U_SerRate as'Service Unit Price',INV1.Price as 'Unit Price',OINV.DocNum as 'Doc Number', OINV.Header as 'T&C1',OINV.Footer AS'T&C2'
from OINV 
left join INV1 on OINV.DocEntry = INV1.DocEntry
LEFT JOIN OCRD ON OINV.CardCode = OCRD.CardCode
left join CRD1 on OCRD.DocEntry = OCRD.DocEntry
LEFT join OCPR on OCRD.CardCode = OCPR.CardCode


where DocNum = 100029


Regards