Solved

Cummulative Line chart

Posted on 2003-11-10
6
291 Views
Last Modified: 2008-03-10
Hi Guys,

I have a table with three fields, Weeknno, Office and Cases. I want to produce a line chart that shows the cumulative total number of cases for each office over the weeks. For example, if I have 3 offices, each office would have a different line represented on the graph showing its growing total number of cases over a period of time. Th einformation is currently stored in a table like:

Weekno |  Office  | No Cases
01         | London |  26
01         | Paris    |  32
02         | London | 14         (cumulative total would be 40)
02         | Paris     | 4          (cumulative totla would be 36)

.. and so on...

Is it posssible to do this?

Many thanks

Ensa
0
Comment
Question by:ensa
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9715287
Hi ensa,
You can make a query like this to create the accumulated figures to base your graph on:

SELECT tbl.WeekNo, tbl.office, DSum("[No Cases]","tbl","WeekNo <= " & [WeekNo] & " AND [office]=" & [office]) AS AccCases
FROM tbl
ORDER BY tbl.WeekNo, tbl.office;


Kind regards,
Sven
0
 

Author Comment

by:ensa
ID: 9715437
Hi Sven,

Thanks for the prompt reply. Unfortunatly, the output produces #error, when I try this. When I mouse over the column a msgbox says 'The object doesn't contain the automation object' and then displays the name of the office. All the fields and table name are spelt correctly. Any ideas?

Thanks again

Ensa
0
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9715540
Ensa,

could you post the query you've made here as SQL, please ?

Sven
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:ensa
ID: 9715607
Sven,

SQL below as you posted with the table entered.

SELECT CSOfficesTab.WeekNo, CSOfficesTab.office, DSum("[No Cases]","CSOfficesTab","WeekNo <= " & [WeekNo] & " AND [office]=" & [office]) AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.WeekNo, CSOfficesTab.office;



Ensa
0
 

Author Comment

by:ensa
ID: 9715652
Hi Sven,

Sorted it!

Correct SQL needed single quotes round in the Dsum ie.

SELECT CSOfficesTab.Weekno, CSOfficesTab.OFFICE, CSOfficesTab.[No Cases], DSum("[No Cases]","CSOfficesTab","WeekNo <= '" & [WeekNo] & "' AND [office]='" & [office] & "'") AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.Weekno, CSOfficesTab.OFFICE;


Now working perfectly. Many thanks for your help.

Ensa
0
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 250 total points
ID: 9715844
hmmmm, - could try this:

SELECT CSOfficesTab.WeekNo, CSOfficesTab.office, DSum("[No Cases]","CSOfficesTab","WeekNo <= " & CSOfficesTab.WeekNo & " AND [office]='" & CSOfficesTab.office & "'") AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.WeekNo, CSOfficesTab.office;


Sven
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now