20-12-2008, 05:04 PM
السلام عليكم 

PHP كود :
procedure TForm1.ComboBox1Change(Sender: TObject);
var
Date1,Filr,DayMod:String;
I,Y:Integer;
begin
Y:=Length(DateToStr(Date));
I:=(Combobox1.ItemIndex+1);
Date1:=Copy(DateToStr(Date),7,Y-6);
//---------------------------------//
if ((i)<=(7)) And (i<>2) then
if (i) mod 2 = 0 then DayMod:='30' else DayMod:='31';
if (i)>=(8) then
if (i) mod 2 = 0 then DayMod:='31' else DayMod:='30';
//---------------------------------//
if I=2 then
begin
DayMod:='29';
Filr:='Date >='+'01'+'-'+inttostr(i)+'-'+Date1+' '+
'And'+' '+ 'Date <='+DayMod+'-'+inttostr(i)+'-'+Date1;
end
else
Filr:='Date >='+'01'+'-'+inttostr(i)+'-'+Date1+' '+
'And'+' '+ 'Date <='+DayMod+'-'+inttostr(i)+'-'+Date1;
Table1.Filtered:=true;
Table1.Filter:=Filr;
Caption:=Filr+' , '+'Day= '+DayMod;
end;

