Einzelnen Beitrag anzeigen

Benutzerbild von recordable
recordable

Registriert seit: 9. Dez 2004
Ort: Neubrandenburg
9 Beiträge
 
#7

Re: Daten aus DB in StringGrid und aus StringGrid in Excelda

  Alt 9. Dez 2004, 12:39
Delphi-Quellcode:
Query1.SQL.Clear;
    Query1.SQL.Add('select max(TATSAECHLENTGELT_QM) from feh_bearbeitung where TATSAECHLENTGELT_QM is
not null and TATSAECHLENTGELT_QM > 0
');
    Query1.SQL.Add('and leistpflichtvon >= ''01.01.2002'' and leistpflichtvon <= ''01.01.2004''');
    Query1.SQL.Add('and id_wohnung in ( select id_wohnung from woh_bestand where id_wohnung =
feh_bearbeitung.id_wohnung and datum_bewilligungsbescheid >=
''01.01.1960'' and
datum_bewilligungsbescheid <=
''31.12.1960'')');
    Query1.SQL.Add('group by tatsaechlentgelt_qm');
    Query1.Active := true;

    while not Query1.Eof do
    begin
      if CheckBox1.Checked then
      begin
      stringgrid1.Cols[1].Add(Query1.fieldbyname('max(TATSAECHLENTGELT_QM)').AsString);
      StringGrid1.RowCount := StringGrid1.RowCount+1;
      end;
    Query1.Next
    end;
So hat ich mir das eigentlich gedacht.

[edit=MrSpock]Delphi Code Tags eingefügt. Mfg, MrSpock[/edit]
  Mit Zitat antworten Zitat