SELECT p.tmbpart, v.hn, p.cid , CONCAT(p.pname,p.fname," ",p.lname) as pt_name,
v.age_y, p.addrpart, d.district, d.amphur, d.province, v.vstdate
FROM vn_stat v
INNER JOIN patient p ON p.hn = v.hn
INNER JOIN dbaddress d ON d.iddistrict = CONCAT(p.chwpart,p.amppart,p.tmbpart)
WHERE v.vstdate BETWEEN "2012-08-01" and NOW()
ORDER BY p.tmbpart