DSum Total

G

Guest

My formula works perfectly and this is the SQL: SELECT [Invoices].[Customer
Name], [Invoices].[Invoice Date], [Invoices].[Invoice Number],
[Invoices].[Description], Sum([Invoices].[Invoice Total]) AS [SumOfInvoice
Total], [Invoices].[GL Number], Format(DSum("[Invoice Total]","Invoices","[GL
Number] = '68300-750'And [Invoice Number]<=" & [Invoice Number]),"$000.00")
AS RunTot
FROM Invoices
GROUP BY [Invoices].[Customer Name], [Invoices].[Invoice Date],
[Invoices].[Invoice Number], [Invoices].[Description], [Invoices].[GL Number]
HAVING (((Invoices.[GL Number])="68300-750"))
ORDER BY [Invoices].[Invoice Date];

The fields are Customer Name, Invoice Date, Invoice Number, Description, Sum
of Invoice, GL Number and Run Tot. This all works, however, there are few
customers and they repeat. When I single out a specific GL Number to run a
total, with repeat customers, sorting in ascending order by date, the Run
Total totals the first date and each matching customer associated with that
date, then finds the next earliest date and totals each matching customer in
that group, therefore I end up with the correct run total somewhere in the
middle of the report instead of totaled straight down by date only. Any
suggestions? Thank you!
 
E

Ed Robichaud

You don't say how your report is organized, but it sounds like you have none
or incorrect groups. If you want to report sub-totals by customer, create a
group (with header & footer) based on customerID.
-Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top