select avg(t1.fintervaltime/30) fintervaltime
from DSBCRM..tstore_rebuildlog t1
inner join DSBCRM..tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
where t1.siteid =$siteid$ and t2.fsaleruserid in $tenterprise_userid$
