473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cumulative Sum

Please Help!

I have a list of customers and invoices and what I what to do is firstly sum the invoices by customer and then order them from top to bottom. I then want to calculate the cumulative sum of the grouped invoices which I am having a problem with. I have tried to do something like the following but I am doing something wrong.


SELECT [Sales].[Customer No], Sum([Sales].[Invoice]) AS SumofInvoice, (Select Sum(Invoice) From Sales As SalesCopy
Where Invoice >= [Sales].[Invoice]) As Cumulative
From [Sales]
GROUP BY [Sales].[Customer No]
Order BY Sum([Sales].[Invoice]);
Mar 23 '07 #1
0 1951

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Yannick Turgeon | last post by:
Hello all, I've got a query which suddently became very slow. It now takes about 10 secs instead of 2 secs. I've got to identical DB (one is for test and the other is production). The query...
4
by: Matt Larkin | last post by:
I am pulling my hair out trying to solve this one (presumably because I am not particularly trained or skilled at access!) I have a query which summarises the variances that each of my sales...
1
by: Victor | last post by:
Hi There, I have a query witch gives me the following result: Period NumberOfItems 1 13 2 2 3 1 4 1 5 1
4
by: cefrancke | last post by:
Are there any ways to speed up a Cumulative sum in a query or perhaps another faster way to have a cumulative sum column (call a vba function?). For example, I want to sum up all values under...
34
by: David Isaac | last post by:
What's the good way to produce a cumulative sum? E.g., given the list x, cumx = x for i in range(1,len(x)): cumx = cumx+cumx What's the better way? Thanks, Alan Isaac
0
by: James Hallam | last post by:
I have searched through the news groups and found many threads close to what I want but cannot get any of them to work... I have a table with expenses and invoices, what I want is a bar chart...
3
ChaseCox
by: ChaseCox | last post by:
Hi all, I have a problem that I have been looking at for a couple days now and I can not quite get it to work. I would like to calculate the cumulative percent failure of a certain product in...
1
by: wisemen | last post by:
I have a table with 2 columns, and .I want to run a query that will give me a cumulative sum of the no. of entries that have an <= and on the second column give me a cumulative sum of the no. of...
1
by: cbellew | last post by:
Hi guys, i'm looking to create a report with a table showing totals (running and cumulative) of education sessions attend by the staff at a hospital. I'm trying to get the table to show something...
4
by: JAG | last post by:
The following line of code worked in my .hta prior to installing MS08-045 - Cumulative Security Update for Internet Explorer (953838) (on both XP and W2K): window.top.frames.location = ; After...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.