function GetICDRangeCount_UC30_InRegion(icd1,icd2:string;bd1,bd2:TDateTime):integer;
begin
result:=0;
try
result:=getsqldata('select count(v.hn) as cc from vn_stat v,ovstdiag o where v.vstdate between "'+formatdatetime('yyyy-mm-dd',bd1)+'" '+
' and "'+formatdatetime('yyyy-mm-dd',bd2)+'" and v.vn=o.vn and o.icd10 between "'+icd1+'" and "'+icd2+'" and v.pcode in ('+
uc30_pcode+') and v.pttype_in_region="Y" ');
except
on e:exception do
begin
showmessage(e.message);
end;
end;
end;
fcds['mon1']:=fcds['mon1']+GetICDRangeCount_UC30_InRegion(fcds3['code1'],fcds3['code2'],d1,d2);
mon ไม่เห็นมีกำหนด
ลองส่ง
report ออกมาดูหรือ script