select a.hn,pt.pname,pt.fname,pt.lname
,a.vstdate,a.clinic,c.name clinicname,a.app_user
,cast(replace(replace(a.note2,char(13),','),char(10),'') as char(100)) Lab
from oapp a
left join patient pt on a.hn=pt.hn
left join clinic c on c.clinic=a.clinic
where a.nextdate between '2013-1-1' and '2013-1-10'
and a.note2 is not null
order by a.hn