Q&A

  • sum(필드명) 한값을 에디트박스로 보내기...부탁해요
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;

3  COMMENTS
  • Profile
    오늘맑음 2001.12.06 06:21
    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;

    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;

  • Profile
    나두초보 2001.12.06 06:16
    초보아씨 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;



    open 한 후에

    edit3.Text:= FieldByName('Total').AsString ;



    edit3.text := query2.fieldbyname('total').asstring;



  • Profile
    초보아씨 2001.12.06 06:36
    고수님들...



    빠른 답변 감사드립니다.



    얼마남지않은 2001잘 마무리하세용