Table creating duplicate rows
I am creating a report using SSRS 2008. The report have a table which will contain the data. My database doesn't have duplicate records but when i run the report its creating 3 duplicates. My query is as follows:
SELECT PurchaseOrders.PurchaseOrderNumber, PurchaseOrders.[PRF ID], PurchaseOrders.GrandTotal, PurchaseOrders.DateofDelivery, PurchaseOrders.FreightInsurance,
PurchaseOrders.VAT, PurchaseOrders.FreightCost, PurchaseOrders.PrimaryApproval, PurchaseOrders.SecondaryApproval, PurchaseOrders.PaymentTerms,
PurchaseOrders.PaymentMethod, PurchaseOrders.Currency, PurchaseOrders.DeliveryAddress, PurchaseOrders.ContactPerson, PurchaseOrders.Telephone,
PurchaseOrders.PricesIncludeVat, PurchaseOrderItems.Quantity, PurchaseOrderItems.Description, PurchaseOrderItems.UnitCost,
PurchaseOrderItems.UnitCost * PurchaseOrderItems.Quantity AS LineTotal, PurchaseRequisitions.RequestedBy, Suppliers.Name AS SupplierName,
Suppliers.ContactPerson AS SupplierContact, Suppliers.Email AS SupplierEmail, Suppliers.Fax, Suppliers.Telephone AS SupplierPhone,
Suppliers.Address AS SupplierAddress, PurchaseRequisitionItems.ItemCategory, PurchaseRequisitionItems.ItemType
FROM PurchaseOrders INNER JOIN
PurchaseOrderItems ON PurchaseOrders.PurchaseOrderNumber = PurchaseOrderItems.PurchaseOrderNumber INNER JOIN
PurchaseRequisitions ON PurchaseOrders.[PRF ID] = PurchaseRequisitions.[PRF ID] INNER JOIN
WinningQuotations ON PurchaseOrders.BidID = WinningQuotations.BidID AND PurchaseRequisitions.[PRF ID] = WinningQuotations.[PRF ID] INNER JOIN
Quotations ON PurchaseRequisitions.[PRF ID] = Quotations.[PRF ID] AND WinningQuotations.SelectedQuotation = Quotations.QuotationID INNER JOIN
Suppliers ON Quotations.SupplierID = Suppliers.SupplierID INNER JOIN
PurchaseRequisitionItems ON PurchaseRequisitions.[PRF ID] = PurchaseRequisitionItems.[PRF ID]
WHERE (PurchaseOrders.PurchaseOrderNumber = @PO)
Good is not good enough when best is expected !!!
May 26th, 2012 10:09am
Its hard to figure out why you are getting the duplicate rows without seeing the data. Your best bet is try to order them and see if any of them came out the same.Think out of the box
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2012 10:35am


