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
|
var annee:string;
y,m,d:word;
Date1, Date2 : TDateTime;
Diff : Extended;
Jour1, Mois1, Annee1 : Word;
Jour2, Mois2, Annee2 : Word;
begin
decodedate(now(),y,m,d);
annee:=inputbox('Veuillez entrer l''anée ','Année ','31/12/'+inttostr(y));
Date1 := EncodeDate(y, M, d);
Annee2:=strtoint(copy(annee,7,4));
Mois2:=strtoint(copy(annee,4,2));
Jour2:=strtoint(copy(annee,1,2));
Date2 := EncodeDate(Annee2, Mois2, Jour2);
Diff := Date2 - Date1;
diff:=-1*diff;
with dm.ADOQIEP do
begin
close;
sql.Clear;
sql.Add('SELECT perso.nompren, perso.nbrean,');
sql.Add(' Int((Now()-'+floattostr(diff)+'-[dtentree])/365) AS IEPCDIC,');
sql.Add(' perso.dtentree, perso.Num');
sql.Add(' FROM perso');
... |
Partager