Month to Month Data Adding?

B984rnr

New member
Local time
Today, 05:40
Joined
Sep 20, 2011
Messages
7
I have a chart that plots a number of injuries in their respective month (attached JPG). What I would like it to do is actually add Feb to Jan and plot it in Feb. Then add Mar to Jan+Feb and plot it in Mar. And so on until you have Dec added to all previous 11 months and plotted in Dec. Is there a way to do this?

Also, I have the same graph showing in the cross tab query. How can I display that graph instead of the table in a report?

All injuries chart.JPG
 
I have a chart that plots a number of injuries in their respective month (attached JPG). What I would like it to do is actually add Feb to Jan and plot it in Feb. Then add Mar to Jan+Feb and plot it in Mar. And so on until you have Dec added to all previous 11 months and plotted in Dec. Is there a way to do this?

Also, I have the same graph showing in the cross tab query. How can I display that graph instead of the table in a report?

View attachment 38870

Anybody? Bump.
 
This is what I came up with to add up injuries from previous months. Need to create a query. I've got 2 fields. One is the month--pretty straight forward. The other is going to add up the current month's plus previous months' injuries. Without knowing your field and table names, I came up with my own. I hope they're self-explanatory. Anyway, here is what the fields in the query should look like:

Field 1
fldMonth

Field 2
Number_of_Injuries: DSum("[fldNumberofInjuries]","tblMonth_vs_NumberofInjuries","[fldMonth] <= " & [fldMonth])

This should work if your Month field data type is set to a number. Let me know if that's working for you.
 
This is what I came up with to add up injuries from previous months. Need to create a query. I've got 2 fields. One is the month--pretty straight forward. The other is going to add up the current month's plus previous months' injuries. Without knowing your field and table names, I came up with my own. I hope they're self-explanatory. Anyway, here is what the fields in the query should look like:

Field 1
fldMonth

Field 2
Number_of_Injuries: DSum("[fldNumberofInjuries]","tblMonth_vs_NumberofInjuries","[fldMonth] <= " & [fldMonth])

This should work if your Month field data type is set to a number. Let me know if that's working for you.

I thought it made sense reading it, but applying it is a different story. I've attached a rough database. I'm thinking maybe I have my data setup incorrectly.

I appreciate your help.
View attachment Database1 9-26-11 (blank data).accdb
 
I didn't look to see if you had everything set up correctly, but a quick glance looks ok. I've attached your database with a new query called "qryNumberOfInjuriesPerMonth". See if that's what you're looking for.
 

Attachments

I didn't look to see if you had everything set up correctly, but a quick glance looks ok. I've attached your database with a new query called "qryNumberOfInjuriesPerMonth". See if that's what you're looking for.

That is exactly what I was looking for. Thank you.

Now how do I get that into a graph in a report?
 
In your Form Design view, add a new chart and follow the wizard. Once it's done, change the Row Source to

SELECT qryNumberOfInjuriesPerMonth.Month, qryNumberOfInjuriesPerMonth.Number_of_Injuries FROM qryNumberOfInjuriesPerMonth;

Then you can play around with the format and stuff.
 

Users who are viewing this thread

Back
Top Bottom