Hi. I am trying to run an aggregate query where I am summing up the values in one table based on criteria contained in another table. The table that has the criteria has two records for each unique record in the summing table, so I am getting numbers that are 2X what they should be. Is there a type of join that will only return the rows from one table while using the other tables as criteria?Here is my example...SELECT Service.Name,SUM(TransactionComparison.Calculation1TotalRate) AS Calc1, SUM(TransactionComparison.Calculation2TotalRate) AS Calc2,FROM TransactionComparisonINNER JOIN TransactionCalculation ON TransactionComparison.TransactionID = TransactionCalculation.TransactionID INNER JOIN Service ON TransactionCalculation.ServiceID = Service.IDWHERE (TransactionComparison.ComparisonID = @ComparisonID) AND (TransactionCalculation.Status IN (0, 20)) AND (TransactionCalculation.ServiceID IS NOT NULL) GROUP BY Service.Name
The TransactionCalculation Table has two records for each TransactionID in the TransactionComparison table so my numbers are twice what I am looking for...Any ideas?Thanks a heap!-Greg