baby_vn :=
getsqlsubquerydata('select distinct b1.vn from baby_visit b1,ovst o where o.vstdate '
+
' between "' + d1 + '" and "' + d2 + '" and o.vn=b1.vn ');
fp_vn :=
getsqlsubquerydata('select distinct b1.vn from fp_visit b1,ovst o where o.vstdate '
+
' between "' + d1 + '" and "' + d2 + '" and o.vn=b1.vn ');
anc_vn :=
getsqlsubquerydata('select distinct b1.vn from anc_visit b1,ovst o where o.vstdate '
+
' between "' + d1 + '" and "' + d2 + '" and o.vn=b1.vn ');
service_exclude_cri:=' and vn not in ('+baby_vn+','+fp_vn+','+anc_vn+') ';