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]
Showing posts with label wrong. Show all posts
Showing posts with label wrong. Show all posts
Friday, March 23, 2012
Tuesday, March 20, 2012
Running SQL Server Job in an Excel Macro
I know this might be the wrong forums, but I thought that some SQL Server users might know the answer and have accomplished this before. Does anyone know how to run a SQL Server job through an Excel macro? I have the macro where it's entering the data into my database, but now I need to use the data by running the job. Thanks!Call the stored procedure sp_start_job.
Subscribe to:
Posts (Atom)