I am unable to point out the problem that the transaction is being duplicated when a file is attached.
Following is the SQL Query
SELECT Pchase.PurCompanyName, Pchase.PurTransId, Pchase.[Purchase Date], Pchase.[Purchase Description], Pchase.[Party Challan #], Pchase.[Invoice #], Pchase.[Purchase Qty], Pchase.[Purchase Price], Pchase.[Purchase Units], Company.CoId, Pchase.[Pur Seller], ([Payment Made]+[Mobile Deduction]) AS Dbt, Pchase.[Amount Returned], [Purchase Remarks] & " " & [Stored At] & " " & [D2Party] & " " & [SB] & " " & [PPMTTYP] & " " & [TrNo] & " " & [Cheque PO #] & " " & [Podtd] & " " & [Ref] AS Rem, IIf([Amount Returned]=0,([Purqty]*[Purchase Price]+[GST Amount]),[Amount Returned]) AS PurCredit, Pchase.[Pur Varification], Pchase.[Cheque PO #], [Purchase Description] & " " & [Salery Month] AS Des, IIf([Supplier Bank]="Nil",Null,[Supplier Bank]) AS SB, IIf([Payment Type]="Nil",Null,[Payment Type]) AS PPMTTYP, IIf([Delivered To Party]="Nil",Null,[Delivered To Party]) AS D2Party, Pchase.purattach, Pchase.[Mobile Deduction], Pchase.[Payment Made], IIf(IsNull([purattach].[FileData])," ","Yes") AS Patt, Company.[NIC No], Voucher.VoucherNo, [Party Challan #] & " " & [VoucherNo] AS GPVOU, IIf([Truck #]="Nil"," ",[Truck #]) AS TrNo, Company.CoAttach, Company.NICcopyFront, Company.NICcopyBack, Pchase.[GST Rate], Pchase.[GST Amount], Pchase.[Total Amount], Pchase.GSTR, Pchase.Purqty, Pchase.[Purchase Cash Qty], Pchase.[Purchase Sales Tax], IIf(IsNull([purattach].[FileData])," ","@") AS ACatt, [Purchase Remarks] & " " & [Ref] AS ACattRem, Company.Mobile, Pchase.PurDate, IIf([Cheque PO #]>0,[Chq PO Date]," ") AS Podtd, Pchase.[EntryPLogin By], IIf([EntryPLogin By]="Aamer Sheikh","AAS",[EntryPLogin By]) AS TransBy, Pchase.[SupervisePLogin By], Company.ComapnyName, Company.EmployeeWorkLoc, Pchase.[Delivered To Party]
FROM (Company INNER JOIN Pchase ON Company.ComapnyName = Pchase.PurCompanyName) LEFT JOIN Voucher ON Pchase.PurTransId = Voucher.[Vou ID]
ORDER BY Pchase.PurTransId, Pchase.[Purchase Date];
Kindly guide me how to fix the duplication of transaction.
Thanks