select t1.fagentnum,t1.fagentname,t1.fcontact,t1.fphonenumber,t1.fprovince,t1.fcity,t1.fcounty,t2.fname as fsalername from DSBCRM..tagents t1
left join DSBCRM..tenterprise_users t2 on t1.siteid=t2.siteid and t1.fsaleruserid=t2.tenterprise_userid
where t1.siteid=$siteid$ and exists(select * from tuserrequestlog t2 where t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid and convert(varchar(10),t2.fdate,120)=convert(varchar(10),getdate(),120))
