
update vs4tempSlipDoc set tepssfundamass=(select top 1 tsmbamassamount from VS4VEmployeeSlip where VS4VEmployeeSlip.tepstempcode=vs4tempSlipDoc.tepstempcode and  VS4VEmployeeSlip.tepscheckgroup=vs4tempSlipDoc.tepscheckgroup and tsmbtamtalias='SFUND' and tepsbalanceflag=1) where tepstsapdate='11/28/2006'

update vs4tempSlipDoc set tepssfundamass=(select top 1 tsmbamassamount from VS4VEmployeeSlip where VS4VEmployeeSlip.tepstempcode=vs4tempSlipDoc.tepstempcode and  VS4VEmployeeSlip.tepscheckgroup=vs4tempSlipDoc.tepscheckgroup and tsmbtamtalias='SFUND' and tepsbalanceflag=0) where tepstsapdate='12/28/2006'
update vs4tempSlipDoc set tepssfundamass=tepssfundamass+tepssfund where tepstsapdate='12/28/2006'
