I am trying to create a query that will give me a total amount per account. In this table that I have to work on, will have one account number that is duplicated all throught the table but it will be one customer. The customers payment history resides in this table, what they want is for the customers total amount they have paid for the year to show up in a report. So I need to create a report with that shows one record per customer/account number with the total amount that customer paid. So that way the report will show they customers their number and what they paid for the year. I am having such a hard time with this, theres no relationship within the database.
SELECT dbo.Employee_Fines.[TM #], SUM(dbo.FinePayments_Tbl.FinePayment) AS [Fine Payment], MIN(dbo.FinePayments_Tbl.DateOfPayment)
AS [Date of Payment], MIN(dbo.FinePayments_Tbl.FineAmount) AS Amount
FROM dbo.Employee_Fines FULL OUTER JOIN
dbo.FinePayments_Tbl ON dbo.Employee_Fines.[TM #] = dbo.FinePayments_Tbl.[TM #]
GROUP BY dbo.Employee_Fines.[TM #]