SELECT idreport,val,seq,fname,name,sname,datebuy,totalpay,stat,statusreport.text FROM report LEFT JOIN member ON report.idmember = member.idregis LEFT JOIN statusreport ON report.stat = statusreport.idstatusreport WHERE report.idreport = (SELECT d_val,d_seq FROM report_detail WHERE report_detail.idproduct = '1' )
ปล. val = ปีออกใบเสร็จ , seq = เลขที่ใบเสร็จของปี val