select e.vn,o.hn,o.an
,e.vstdate
,date_format(o.vsttime,'%T') 'vsttime'
,date_format(e.enter_er_time,'%T') 'Enter_ER_Time'
,cast(sec_to_time(timestampdiff(second,timestamp(e.vstdate,o.vsttime),enter_er_time)) as char(10)) 'To_ER_time'
from er_regist e
left join ovst o on o.vn=e.vn
where e.vstdate between "2011-09-01" and "2011-09-30"
ประมาณนี้มั๊ย