Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2006

Tip: Looking for answers? Try searching our database.

Cumulative sum

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jumilu - 29 May 2006 17:50 GMT
Hi,

I have a table where the fields are Area (number), Month (text (rather than
date because some of the data in this field are "unknown")), and Power
(number).

An example of data in this table is:
Area    Month    Power
1    jun    2
1    jun    3
1    sep    2   
1    sep    5
2    jan    6
2    jun    8
3    apr    10
3    apr    1
3    jun    2

I need a query that will provide the cumulative sum by Month of the Power by
Area.

Example of required output:
Area    jan    apr    jun    sep
1            5    12
2    6        14   
3        11    13

I have tried building smaller queries and then using those in bigger queries
but I am getting nowhere. I've been trying to create this query in Query
Design rather than in the SQL view.

Any help will be GREATLY appreciated.

Thanks.
Ofer Cohen - 29 May 2006 18:33 GMT
Try a CrossTab Query, such as

TRANSFORM Sum(TableName.Power) AS SumOfPower
SELECT TableName.Area
FROM TableName
GROUP BY TableName.Area
PIVOT TableName.Month;

Signature

Good Luck
BS"D

> Hi,
>
[quoted text clipped - 30 lines]
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.