Tengo problemas con los filtros pues los estoy usando constantemente.
en ciclos y la verdad no me da los resultados que yo espero.
Código Delphi
[-]
var
i,j:integer;
x1,x2,x3,x4:integer;
fe1,fe2:integer;
Sfecha:string;
Dfecha:Tdate;
begin
i:=0; x1:=0;
x2:=0; x3:=0;
x4:=0; j:=0;
fe1:=0; fe2:=0;
j:=Random(10);
fe1:=Random(31);
fe2:=Random(3);
Sfecha:=IntToStr(fe1)+'/'+IntToStr(fe2)+'/'+'2007';
Label12.Caption:=IntToStr(j);
for i:= 1 to j do
begin
fe1:=Random(30);
fe2:=Random(3);
if(fe1 = 0) then
fe1:=1;
if(fe2 = 0) then
fe2:=1;
if((fe2 = 2)and(fe1>=28)) then
begin
fe1:=1;
fe2:=3;
end;
Sfecha:=IntToStr(fe1)+'/'+IntToStr(fe2)+'/'+'2007';
Dfecha:=StrToDate(Sfecha);
DateTimePicker1.Date:=Dfecha; can1:= Random(2147483647);
can2:= Random(2147483647);
can3:= Random(2147483647); x1:= Random(24);
x2:= Random(24);
x3:= Random(24);
x4:= Random(24); ComboBox1.Text:=nombress[x1];
ComboBox2.Text:=apellidos[x2];
ComboBox3.Text:=apellidos[x3];
ComboBox4.Text:=ciudadd[Random(24)];
ComboBox5.Text:=ciudadd[x4]; Edit6.Text:=IntToStr(can1);
Edit7.Text:=IntToStr(can2);
Edit8.Text:=IntToStr(can3);
ComboBox1.Text := strupper(Pchar(ComboBox1.Text));
ComboBox2.Text := strupper(Pchar(ComboBox2.Text));
ComboBox3.Text := strupper(Pchar(ComboBox3.Text));
ComboBox4.Text := strupper(Pchar(ComboBox4.Text));
ComboBox5.Text := strupper(Pchar(ComboBox5.Text));
Edit6.Text := strupper(Pchar(Edit6.Text));
Edit7.Text := strupper(Pchar(Edit7.Text));
Edit8.Text := strupper(Pchar(Edit8.Text));
Memo1.Text := strupper(Pchar(Memo1.Text));
Form1.Table1.Insert;
Form1.table1.fieldbyname('Nombre').asstring := ComboBox1.Text;
Form1.table1.fieldbyname('Apellidop').asstring := ComboBox2.Text;
Form1.table1.fieldbyname('Apellidom').asstring := ComboBox3.Text;
Form1.table1.fieldbyname('Domicilio').asstring := ComboBox4.Text;
Form1.table1.fieldbyname('Entidad').asstring := ComboBox5.Text;
Form1.table1.fieldbyname('Ife').asstring := Edit6.Text;
Form1.table1.fieldbyname('Referencia').asstring := Edit7.Text;
Form1.table1.fieldbyname('Concepto').asstring := Memo1.Text;
Form1.table1.fieldbyname('Fecha').AsDateTime := Dfecha; Form1.table1.fieldbyname('Monto').asstring := Edit8.Text;
Form1.Table1.Post;
Label11.Caption:=IntToStr(i);
Application.ProcessMessages;
end;
end;
lo probe con una tabla duplique la tabla y a la tbla dos le agregue 5 campos que no fueran posibles que estuvieran en la tabla 1 y cuando terminaba, me decia que tenia 10 registros insertados.
de una tabla de 10 registros repetidos y 5 registro nuevos de la tabla dos, asi que a lo mucho deberia tener 5 registro y pareciere tenia un 33%.
//Lo Edite para agregar las etiquetas Delphi
//Nota: Por favor usenlas...