SELECT a.WAccountid from transact tr join account a on (tr.Waccountid = a.WAccountid and a.WAccountTypeID = 1)
 where tr.dsysdate >= <@OPENDENTOSF_LASTD@>
group by WAccountid
