select r.bill_date_time,r.department,r.finance_number as finance_no,p.hn,
concat(p.pname,p.fname,' ',p.lname) as ptname,
t.name as pttype_name,v.age_y ,a.age_y as age_ya,a.pcode as pcodea,
r.total_amount,r.discount,r.bill_amount,r.rcpno,r.user,r.computer
from rcpt_print r
left outer join vn_stat v on v.vn=r.vn
left outer join an_stat a on a.an = r.vn
left outer join patient p on p.hn=r.hn
left outer join pttype t on t.pttype=r.pttype
where r.bill_date_time between '2016-01-14 00:00:00' and '2016-01-14 23:59:59'
order by r.finance_number