AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi Problem mit UNION Select
Thema durchsuchen
Ansicht
Themen-Optionen

Problem mit UNION Select

Ein Thema von mu8zeh · begonnen am 6. Mai 2008 · letzter Beitrag vom 10. Mai 2008
Antwort Antwort
mu8zeh

Registriert seit: 31. Mai 2007
36 Beiträge
 
#1

Re: Problem mit UNION Select

  Alt 6. Mai 2008, 16:45
Hallo

die Anzahl ändert sich je nach eingabe

Mal noch ein bsp. wie ich's jetzt habe. Bis zu 5 PERSNR geht's ganz flott.

//**********************************
//Datum wird bereit gestellt
//**********************************

With Form1.StringGrid1 do begin
For NZ:= 4 to ColCount do begin
Cells[NZ,4]:= '';
Cells[NZ,0]:= FormatDateTime('ddd',dDatum);
Cells[NZ,1]:= FormatDateTime('dd',dDatum);
Cells[NZ,2]:= FormatDateTime('m',dDatum);
Cells[NZ,3]:= FormatDateTime('YYYY',dDatum);
Cells[NZ,5]:= FormatDateTime('mm',dDatum);
dDatum := dDatum +1;
end;
end;

//************************************************** ***************
//Daten werden geladen
//************************************************** ***************
procedure TForm1.LadeDaten(Sender: TObject; d,m,X,Y,Z,S: Integer);
begin

Z := 0;
while StringGrid2.Cells[0,Z]<> '' do begin
inc(S);
inc(Z);
end;

Z := 0;
with StringGrid2 do
while StringGrid2.Cells[0,Z]<> '' do begin
mxStatusBar1.Panels[3].ProgressBar.Min := 0;
mxStatusBar1.Panels[3].ProgressBar.Max := S;
mxStatusBar1.Panels[3].ProgressBar.Position := Z;

with DataModule1.ZTEMP2007 do begin
SQL.Clear;
SQL.Add('SELECT TEMP2007.DATUM, TEMP2007.TAG, TEMP2007.MONAT, '+
'TEMP2007.JAHR, TEMP2007.PERSONALNR, TEMP2007.URLAUB, '+
'TEMP2007.KURZZEICHEN, TEMP2007.MEMOTEXT, TEMP2007.AENDERUNG, '+
'TEMP2007.AENDERUNGVON, KATEGORIE.COLOR FROM TEMP2007 '+
'INNER JOIN KATEGORIE ON (TEMP2007.KURZZEICHEN = '+
'KATEGORIE.KURZZEICHEN) WHERE TEMP2007.PERSONALNR = '+
QuotedStr(StringGrid2.Cells[0,Z]) +' AND TEMP2007.MONAT >= '+
QuotedStr(StringGrid1.Cells[4,5]) +' AND TEMP2007.JAHR = '+
QuotedStr(StringGrid1.Cells[4,3])+
' AND TEMP2007.KURZZEICHEN <> '+ QuotedStr('-')+' ORDER BY MONAT, TAG');
Active := True;
with StringGrid1 do begin
For X := 4 to StringGrid1.ColCount -1 do begin
Datum := StrToDate(Cells[X,1] + '.' + Cells[X,5] + '.' + Cells[X,3]);
First;
While Not Eof do begin
if FieldValues['DATUM'] = DateToStr(Datum) then begin
with StringGrid3 do
StringGrid3.Cells[x-4,Z] := FieldValues['KURZZEICHEN'];
end;
Next;
end;
end;
end;
Next;
end;
Z := Z+1;
end;
mxStatusBar1.Panels[3].ProgressBar.Position := 0;
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:56 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz