Hi, I have the following query which works fine, but I want modify it so that when t1.Prac_no is the same value then SUM (dbo.qryGrossAmountPerPractice.GrossAmount), any help pleaseSELECT DISTINCT TOP (100) PERCENT 'GPRD' AS Source, CAST(t4.Oracle_no AS INT) AS Source_Supplier, t2.pay_sort_code, t2.pay_acc_num, t2.post_code, t2.pay_method, 'GBP' AS Currency, '0' AS Tax_Percentage, t3.ProjectDesc, '01-M0601-3472-000000-000000' AS Expense_Account, 'GPRD' + ' ' + t2.pay_method AS Paygroup, '1-M0601-5501-000000-000000' AS Liability_Account, t1.Prac_no, t2.prac_eid, t2.payee_name, RIGHT('0000' + '' + CONVERT(nvarchar(20), t1.PaymentRunID), 4) AS PaymentRunID, dbo.qryGrossAmountPerPractice.GrossAmount, t1.ProjectID, t1.DatePaidFROM GPRDTech.gprdsql.TblPracDetails AS t2 INNER JOIN dbo.tblProjectPatients AS t1 ON t2.prac_no = t1.Prac_no INNER JOIN dbo.tblProjects AS t3 ON t1.ProjectID = t3.ProjectID INNER JOIN GPRDTech.gprdsql.TblOracleNos AS t4 ON t2.prac_no = t4.Prac_no AND t2.pay_method = t4.Pay_method INNER JOIN dbo.qryGrossAmountPerPractice ON t1.ProjectID = dbo.qryGrossAmountPerPractice.ProjectID AND t1.Prac_no = dbo.qryGrossAmountPerPractice.Prac_no INNER JOIN dbo.tblCurrCommittProj ON t3.ProjectID = dbo.tblCurrCommittProj.Curr_ProjectID AND t1.PaymentRunID = dbo.tblCurrCommittProj.Curr_CommittedPayRefWHERE (t3.ProjectStatus = 'true') AND (t1.PaymentRunID IS NOT NULL) AND (t1.DatePaid IS NOT NULL)ORDER BY t1.Prac_no