SunQuest
 
           Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 10th, 2008, 01:46 AM
Geoff Taylor Geoff Taylor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 Geoff Taylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 36 sec
Reputation Power: 0
Reports - Graph with group data

I have a table that for the moment has two fields - a value called LEVEL against the date and time of entry called TIME.

TIME is grouped by day and by week.

I have a report that tabulates TIME and LEVEL with a daily group average for LEVEL and a weekly group average for LEVEL and this prints each week's table with the daily average and weekly average in the group footers for day and week.

I now need to insert a graph of LEVEL vs TIME in the weekly group footer. I have created the scatter graph by using a query...

SELECT data.TIME, data.LEVEL, *
FROM data
ORDER BY data.TIME;

and placed it in the weekly group footer.

The weekly table, average and graph displays as I want it, except that the graph displays all data rather than the times for the week for the group data on the page.

How do I restrict the graph to show only the data in the current group based on week?

Reply With Quote
  #2  
Old May 11th, 2008, 08:39 PM
dykebert dykebert is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 71 dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 18 h 8 m 26 sec
Reputation Power: 21
I can think of two ways this could be done. I don't have anything similar to play with so I'm not sure the first method will work, but second should be doable.

1. In your query for the graph add a where clause that restricts the query to the dates for your group. Something like:
SELECT data.TIME, data.LEVEL, *
FROM data
WHERE DatePart("ww",data.Time) = reports!thisReport!week
ORDER BY data.TIME;

2. In the Group Header add code to the OnFormat event to modify the query for the graph. Something like this:

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

Me.grpGraph.rowsource = "SELECT data.Time, data.Level, * FROM data WHERE DatePart("ww", data.Time) = me.grpWeek ORDER BY data.Time

End Sub

I generally don't work with graphs so I may not have right property in the 2nd method so you'll have to change the .rowsource part to whatever the correct property is.

You'll have to taylor either of these to your actual field names etc. but this should give you the idea.

Reply With Quote
  #3  
Old May 24th, 2008, 09:05 PM
Geoff Taylor Geoff Taylor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 Geoff Taylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 36 sec
Reputation Power: 0
Thanks for the tips, however I have had no success.

The query for the page data is...

SELECT data.TIME, data.LEVEL
FROM data
WHERE (((DateValue([data]![TIME]))>=DateValue([From_Date]) And (DateValue([data]![TIME]))<=DateValue([To_Date])))
ORDER BY data.TIME;

And it produces the data between the "From_date" and "To_date" that I supply. If this is used for the row source of the graph, it also produces the correct data for the graph, but with the disadvantage that it pops up the request for the dates every time the graph is encountered onthe screen or on a printout.

Every time I try to add a filter to the "on format" for the TIME footer where the graph is located, it either generates a single value, or it dispalys the last successful data set that was generated by the above query. I cannot seem to alter the row source for the graph so that it uses the same data that generated the report.

This line
FROM data WHERE DatePart("ww", data.Time) = me.grpWeek
has me confused.

Reply With Quote
  #4  
Old May 25th, 2008, 08:48 AM
dykebert dykebert is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 71 dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 18 h 8 m 26 sec
Reputation Power: 21
OK well based on this information I would modify your query like so:

SELECT data.TIME, data.LEVEL, [From_Date], [To_Date]
FROM data
WHERE (((DateValue([data]![TIME]))>=DateValue([From_Date]) And (DateValue([data]![TIME]))<=DateValue([To_Date])))
ORDER BY data.TIME;

This allows the From and To dates to be used in the report like any other field which should fix your problem as I understand it.

The line:
FROM data WHERE DatePart("ww", data.Time) = me.grpWeek

Would only make sense if you were grouping the output data by week. In the original post you didn't specifiy your query or how the Start and End dates were being retrieved so I naturally thought they were coming from the database. In other words it was simply a bad guess on my part. <grin>

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Reports - Graph with group data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway