Graph from multiple columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table like
ID,Temp1, Temp2, .. Temp100

I want to present this as a trend curve in a chart, but it seems like i have
to make a temporary table like
ID, Temp
with 100 records to solve my problem, and then make a chart/trend curve of
this.
Is there any easyer way to do this
1. Directly
2. Indirectly via Query
3. Indirectly via VisualBasic code, temporary table etc.
 
Frank:

The basic problem, as you have found is with your table design. You should
possibly restructure your table to have fields like:

ID, TempID, Value

So the data would look like this:

1, 1, 2.34
1, 2, 4.87

etc.

Other than that if you have variable amounts of "TempX" fields filled by ID
and row, then its pretty hard write a query that will look at how many
fields are filled and transform that (say using a cross tab) into a data set
like you need for the query and chart.
 
I agree, but its not effectivly to insert 100 records for each measurement
from the scada system. There are always 100 values in one measure, so there
will be no free space in the table. Alternatively i can log 100 values in a
table like you say, in a after insert trigger. But then i get double set of
data in my db that needs to be handled.
I think the best way is to make a temporary (access) table with 100 records
when the end user starts the report. Pseudo code:
"
delete * from TmpTable
select record with 100 values from logtable => logTemp[0-99]
For i = 0 to 99
insert into tmptable logTemp
Start report with graphic curve on table TmpTable

.. I dont think its easy to do this in a query ?
 
Back
Top