Results 1 to 3 of 3

Thread: Running total

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unhappy Unanswered: Running total

    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

    Code:
    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)

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    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?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Question Yeah I created a report

    I just went on ahead and created a report instead since I am having difficulty with the form

    Code:
    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •