C
caisunyujia
Unregistered / Unconfirmed
GUEST, unregistred user!
现想用dbchart来画line
with datamodule2 do
query1.open;
query1.sql.clear;
query1.sql.text:='select table1.username,table2.datatime(日期时间型),table2.temperature from table1 inner join table2 on table1.add=table2.add
where datatime>='''+formatdatetime('yyyy-mm-dd',datetimepicker1.date) and datatime<='''+formatdatetime('yyyy-mm-dd',datetimepicker2.date) and username:='''+DBComboBox1.text+'''';
query1.prepare;
try
query1.open;
except
query1.execsql;
end;
while not query1.eof do
begin
datasource3.dataset:=query1;
dbchart1.series[0].datasource:=datasource3;
dbchart1.series[0].addxy(datasource3.dataset.fileds[1].asdatatime,datasource3.dataset.fileds[2].asfloat,'',clred);
dbchart1.series[0].checkdatasource;
dbchart1.autorefresh;
datasource3.dataset.next;
帮我看看哪错了,怎么编译说query1:field'datamodule2.datasource3.dataset.fields[2]'not found
我在sql里选了select username,datatime,temperature,
dbgrid里也显示出了正确结果,怎么就画不出来呢
with datamodule2 do
query1.open;
query1.sql.clear;
query1.sql.text:='select table1.username,table2.datatime(日期时间型),table2.temperature from table1 inner join table2 on table1.add=table2.add
where datatime>='''+formatdatetime('yyyy-mm-dd',datetimepicker1.date) and datatime<='''+formatdatetime('yyyy-mm-dd',datetimepicker2.date) and username:='''+DBComboBox1.text+'''';
query1.prepare;
try
query1.open;
except
query1.execsql;
end;
while not query1.eof do
begin
datasource3.dataset:=query1;
dbchart1.series[0].datasource:=datasource3;
dbchart1.series[0].addxy(datasource3.dataset.fileds[1].asdatatime,datasource3.dataset.fileds[2].asfloat,'',clred);
dbchart1.series[0].checkdatasource;
dbchart1.autorefresh;
datasource3.dataset.next;
帮我看看哪错了,怎么编译说query1:field'datamodule2.datasource3.dataset.fields[2]'not found
我在sql里选了select username,datatime,temperature,
dbgrid里也显示出了正确结果,怎么就画不出来呢