อยากให้รายงานนี้แสดงจำนวนผู้ป่วยที่เป็นทั้ง เบาหวานและความดัน ต้องแก้ว่าอย่างไรครับ
procedure Variable43OnCalc(var Value: Variant);
begin
Value := GetSQLStringData('SELECT count(DISTINCT person.person_id) AS c FROM village_organization_member_service '+
' INNER JOIN village_organization_member ON (village_organization_member_service.village_organization_mid = village_organization_member.village_organization_mid) '+
' INNER JOIN house ON (village_organization_member_service.house_id = house.house_id)'+
' INNER JOIN village ON (house.village_id = village.village_id) '+
' INNER JOIN person ON (house.house_id = person.house_id) '+
' INNER JOIN person_chronic ON (person.person_id = person_chronic.person_id) '+
' WHERE house.doctor_code="'+DBPipeline['doctor_code']+'" '+
' and village.village_moo="'+DBPipeline['village_moo']+'" '+
' and person.death ="N"'+
' and person_chronic .icd10 between "I10" and "I159" '+
' and person_chronic .icd10 between "E10" and "E149" ');
end;