อ้างอิง ที่มา ครับ
Declare
Fyear ,year: string;
year_previous :string;
bedcount:integer;
admdate,x,y,md1,md2,md3:integer;
daycount:integer;
a,b,c,d,e,f,g,h,z:Double;
d1 , d2 : Tdatetime;
ds1,ds2,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12 : string;
mm1,mm2,mm3,mm4,mm5,mm6,mm7,mm8,mm9,mm10,mm11,mm12 : string;
em1,em2,em3,em4,em5,em6,em7,em8,em9,em10,em11,em12 : string;
Even
d1 :=GetSQLDateData('select min(vstdate) from ovst');
d2 :=GetSQLDateData('select max(vstdate) from ovst');
ds1 := formatdatetime('yyyy-mm-dd',d1);
ds2 := formatdatetime('yyyy-mm-dd',d2);
fyear := GetPickupList('select distinct(year(vstdate)) + 543 as cc from ovst'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' order by cc Desc' );
year := fyear;
fyear := inttostr(strtoint(fyear) - 543) ;
fyear := inttostr(strtoint(fyear) - 1) ;
m10 := fyear+'-10-01" and "'+ fyear+'-10-31';
mm10:= fyear+'-10-01';
m11 := fyear+'-11-01" and "'+ fyear+'-11-30';
mm11:= fyear+'-11-01';
m12 := fyear+'-12-01" and "'+ fyear+'-12-31';
mm12:= fyear+'-12-01';
em10:= fyear+'-10-31';
em11:= fyear+'-11-30';
em12:= fyear+'-12-31';