Help can anyone see anything wrong with this I am trying to get a running total to show on my form for the users to see, as a team member makes a payment they should be able to see the remaining amount
SELECT SUM(DISTINCT TotalPayments) AS Payment, SUM(AmountDue) AS Due, SUM(FinePayment) AS Fine, [TM #]
FROM dbo.FinePayments_Tbl
GROUP BY [TM #]
HAVING ([TM #] = 9282)Running totals are best handled by your reporting application, but if absolutely necessary you can create them using a nested subquery.
What are you using to display your output?|||I just went on ahead and created a report instead since I am having difficulty with the form
SELECT SUM(DISTINCT dbo.FinePayments_Tbl.TotalPayments) AS Payment, SUM(dbo.FinePayments_Tbl.AmountDue) AS Due,
SUM(dbo.FinePayments_Tbl.FinePayment) AS Fines, dbo.FinePayments_Tbl.FineAmount AS Amount, dbo.FinePayments_Tbl.[TM #],
dbo.Employee_Fines.[FIRST NAME], dbo.Employee_Fines.[LAST NAME]
FROM dbo.FinePayments_Tbl INNER JOIN
dbo.Employee_Fines ON dbo.FinePayments_Tbl.[TM #] = dbo.Employee_Fines.[TM #]
GROUP BY dbo.FinePayments_Tbl.[TM #], dbo.FinePayments_Tbl.FineAmount, dbo.Employee_Fines.[FIRST NAME], dbo.Employee_Fines.[LAST NAME]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment