with query1 do
begin
close;
sql.Clear;
sql.add('SELECT convert( varchar, month( pc_date )) + ' + #39 + '월' + #39 + 'AS fMon, sum( p_gu )AS Sgu, p_name FROM pc_up');
sql.add('WHERE p_name2 = :p0 and p_name = :p1');
sql.add('and pc_date >= :p2 and pc_date <= :p3');
sql.add('GROUP BY pc_date, p_name ORDER BY pc_date');
params[0].AsString := cmbPumMyung.Text;
params[1].AsString := cmbJepum.text;
params[2].AsString := strNday + '-01-01';
params[3].AsString := strNday + '-12-31';
open;
end;
with dbchart1.SeriesList.Series[0] do
begin
dbchart1.SeriesList.Series[0].RefreshSeries;
dbchart1.Series[0].DataSource := query1;
dbchart1.Series[0].Marks.Visible := true;
dbchart1.series[0].XLabelsSource := 'fmon';
dbchart1.Series[0].YValues.ValueSource := 'sgu';
end;
with query3 do
begin
close;
sql.Clear;
sql.add('SELECT convert( varchar, month( pc_date )) + ' + #39 + '월' + #39 + 'AS fMon, sum( p_gu )AS Sgu, p_name FROM pc_up');
sql.Add('WHERE p_name2 = :p0 and p_name = :p1');
sql.add('and pc_date >= :p2 and pc_date <= :p3');
sql.add('GROUP BY pc_date, p_name ORDER BY pc_date');
params[0].AsString := cmbPumMyung.Text;
params[1].AsString := cmbJepum.text;
params[2].AsString := strPday + '-01-01';
params[3].AsString := strPday + '-12-31';
open;
end;
with dbchart2.SeriesList.Series[0] do
begin
dbchart2.SeriesList.Series[0].RefreshSeries;
dbchart2.Series[0].DataSource := query3;
dbchart2.Series[0].Marks.Visible := true;
dbchart2.series[0].XLabelsSource := 'fmon';
dbchart2.Series[0].YValues.ValueSource := 'sgu';
end;
한 화면에 TDBChart 를 두개를 놓고 사용하려고 하는데 invalid use of keyword 이런 오류가 뜹니다.
Token:varchar, Line Number:1.
query1은 안나는데.... query3에서만 에러가 나니... 뭔지 모르겟어요...고수님들 부탁좀드릴꼐요~
조회조건을 다르게 해서 그래프를 그릴려고 하는데 한개만 있을때는 오류가 뜨지 않습니다.
DB는 mssql 입니다.