if GetSQLIntegerData('select count(vn) as cc from ovst_control_doctor '+
' where vn="'+DBPipeline['vn']+'" ')>0 then
Value := GetSQLStringData('select d.name from ovst_control_doctor o '+
' left outer join doctor d on d.code=o.doctor '+
' where d.position_id="1" and o.vn="'+DBPipeline['vn']+'" ')
else
if GetSQLIntegerData('select count(vn) as cc from ovst '+
' where vn="'+DBPipeline['vn']+'" ')>0 then
Value := GetSQLStringData('select d.name from ovst o '+
' left outer join doctor d on d.code=o.doctor '+
' where d.position_id="1" and o.vn="'+DBPipeline['vn']+'" ')
else
Value := "ไม่ระบุ";