sum 으로 금액함을구해 total에 넣었는데요
total값을 어떻게 에디트 박스로 가져오죠
total 이라는것이 필드에 만들어져있어야하나요
고수님 부탁합니다...
query2.close;
query2.SQL.Clear;
query2.sql.Add('select sum(금액)as total from gagebu.db');
query2.sql.Add('where 날짜 between :now1 and :now2');
query2.parambyname('now1').asdatetime:=DateTimePicker1.Date;
query2.parambyname('now2').asdatetime:=DateTimePicker3.Date;
if combobox3.text<>'수입,지출' then
begin
query2.sql.Add(' and 구분 like "%' + combobox3.text + '%"');
end;
if combobox4.text <> '' then
begin
query2.SQL.add(' order by ' + combobox4.text+ ' asc ');
end;
edit3.Text := FieldByName('Total').AsString ;///이곳을 어떻게 바꿔야하나요
query2.open;
end;
query2.SQL.Clear;
query2.sql.Add('select sum(금액)as total from gagebu.db');
query2.sql.Add('where 날짜 between :now1 and :now2');
query2.parambyname('now1').asdatetime:=DateTimePicker1.Date;
query2.parambyname('now2').asdatetime:=DateTimePicker3.Date;
if combobox3.text<>'수입,지출' then
begin
query2.sql.Add(' and 구분 like "%' + combobox3.text + '%"');
end;
if combobox4.text <> '' then
begin
query2.SQL.add(' order by ' + combobox4.text+ ' asc ');
end;
query2.open;
edit3.Text:= query2.FieldByName('Total').AsString ;
open 이 먼저와야 되는것 빼곤 별로 이상한게 없는것 같은데요.....
초보아씨 wrote:
> sum 으로 금액함을구해 total에 넣었는데요
> total값을 어떻게 에디트 박스로 가져오죠
> total 이라는것이 필드에 만들어져있어야하나요
>
> 고수님 부탁합니다...
>
> query2.close;
> query2.SQL.Clear;
> query2.sql.Add('select sum(금액)as total from gagebu.db');
>
> query2.sql.Add('where 날짜 between :now1 and :now2');
> query2.parambyname('now1').asdatetime:=DateTimePicker1.Date;
> query2.parambyname('now2').asdatetime:=DateTimePicker3.Date;
>
> if combobox3.text<>'수입,지출' then
> begin
> query2.sql.Add(' and 구분 like "%' + combobox3.text + '%"');
>
> end;
> if combobox4.text <> '' then
> begin
> query2.SQL.add(' order by ' + combobox4.text+ ' asc ');
> end;
>
>
> edit3.Text := FieldByName('Total').AsString ;///이곳을 어떻게 바꿔야하나요
>
> query2.open;
>
>
>
> end;