1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| IF Date_Susp.Text <> '' Then
Begin
Liste := TStringList .Create;
myDate := StrToDate( Date_Debut_Activ.Text );
Liste := TStringList.Create;
DecodeDate( myDate, myYear, myMonth, myDay );
myDay := 1;
d := encodedate( myYear, myMonth, myDay );
c := StrToDate( Date_Susp.Text );
While d <= c do
begin
Liste.Add(FormatDateTime( 'yyyymm', d ) );
d := IncMonth( d, 1 );
// partie recherche BDD
end;
ListBox1.Items.AddStrings( Liste );
Liste.Free;
End
Else
Begin
Liste := TStringList .Create;
myDate := StrToDate( Date_Debut_Activ.Text );
Liste := TStringList.Create;
DecodeDate( myDate, myYear, myMonth, myDay );
myDay := 1;
d := encodedate( myYear, myMonth, myDay );
While d <= Date_Actu do
begin
Liste.Add(FormatDateTime( 'yyyymm', d ) );
d := IncMonth( d, 1 );
// partie recherche BDD
end;
ListBox1.Items.AddStrings( Liste );
Liste.Free;
End;
IF ( Date_Susp.Text <> '' ) And ( Date_React.Text <> '' ) Then
Begin
IF StrToDate( Date_Susp.Text ) < StrToDate( Date_React.Text ) Then
Begin
Liste := TStringList .Create;
myDate := StrToDate( Date_React.Text );
Liste := TStringList.Create;
DecodeDate( myDate, myYear, myMonth, myDay );
myDay := 1;
d := encodedate( myYear, myMonth, myDay );
c := Date_Actu;
While d <= c do
Begin
Liste.Add(FormatDateTime( 'yyyymm', d ) );
d := IncMonth( d, 1 );
// partie recherche BDD
end;
End;
ListBox1.Items.AddStrings( Liste );
Liste.Free;
End; |
Partager