Monday, March 12, 2012

Group chart by month

I have a really basic chart that pulls data from a SQL table. I have
the dataset asking for a machine number. The date range is hard coded
in the query for now.
This is my table's basic data...
Machine | Performance | DateTime
____________________________
1125 | 60 | 11/16/06
1125 | 45 | 12/01/06
1125 | 35 | 12/15/06
The results give me all the machines details from sept06 through
feb07. The series is the machine, Y axis is the performace and the X
Axis is the date formated by MM/YY
Right now the chart shows me 3 records. one for 11/06 and two for
12/06. Each record has a bar for the proper performance number.
What I need is 2 records.
11/06 and the bar will represent the avg for all Nov records.
12/06 and the bar will represent the avg for all Dec records.
I'm not sure if I have to change the dataset query or adjust the
groupings or whatever in the table. I'm lost right now."Bruce Lawrence" <BL32375@.gmail.com> wrote in message
news:1170436640.424961.261770@.p10g2000cwp.googlegroups.com...
>I have a really basic chart that pulls data from a SQL
>table. I have
> the dataset asking for a machine number. The date range
> is hard coded
> in the query for now.
> This is my table's basic data...
> Machine | Performance | DateTime
> ____________________________
> 1125 | 60 | 11/16/06
> 1125 | 45 | 12/01/06
> 1125 | 35 | 12/15/06
> The results give me all the machines details from sept06
> through
> feb07. The series is the machine, Y axis is the
> performace and the X
> Axis is the date formated by MM/YY
> Right now the chart shows me 3 records. one for 11/06 and
> two for
> 12/06. Each record has a bar for the proper performance
> number.
> What I need is 2 records.
> 11/06 and the bar will represent the avg for all Nov
> records.
> 12/06 and the bar will represent the avg for all Dec
> records.
> I'm not sure if I have to change the dataset query or
> adjust the
> groupings or whatever in the table. I'm lost right now.
>
I suggest you change the query. You don't mention a primary
key. You need one. You can then filter the data in your SQL
query. May I suggest you ask this question in one of the SQL
Server newsgroups (such as
microsoft.public.sqlserver.newusers, or
microsoft.public.sqlserver.programming) and give them your
full table structure and the query you are using. Include an
example of the results you want and the incorrect results
you are getting now.
Hope this helps.
Ron.

No comments:

Post a Comment