09-06-2009, 01:13 PM
خطأ طفيف في قراءة السنة Y
PHP كود :
var
m,y: word;
d1,d2 : TDateTime;
begin
DateSeparator:='/';
ShortDateFormat:='DD/MM/YYYY';
m:= ComboBox1.ItemIndex + 1; if m=0 then Exit;
y := StrToInt(ComboBox2.Text); //<--- هنا
d1:=EncodeDate(y,m,1);
if m=12 then begin
d2:=EncodeDate(Y+1,1,1);
d2 := d2 -1 ;
end else
d2:=EncodeDate(Y,12,1);
ADOTable1.Filter := '(Dat>='+QuotedStr(DateToStr(d1))+') and (Dat<='+QuotedStr(DateToStr(d2))+')';
ADOTable1.Filtered := True;
end;

