ตัวอย่าง sql ของ Form-LabReport1
select concat(p.pname,p.fname," ",p.lname) as ptname,p.sex,p.birthday,d.name as request_doctor_name,h.*,l.*,i.*
from lab_head h
left outer join lab_order l on l.lab_order_number=h.lab_order_number and l.lab_order_result IS NOT NULL and l.lab_order_result<>'' and l.lab_order_result<>'...'
left outer join lab_items i on i.lab_items_code=l.lab_items_code
left outer join patient p on p.hn=h.hn
left outer join doctor d on d.code=h.doctor_code
where h.lab_order_number='123'
order by l.lab_items_sub_group_code, i.display_order
แล้วกำหนด parameter ที่ lab_order_number ซึ่งในที่นี้คือเลข 123 ครับผม