it is as what the error message said. Your subquery returns more than 1 row.Run this by itself and you will see.select count(*)from tblmivdet E,tblmivs M, tblbudget bwhere e.prjid=b.prjid and e.csicode=b.bcode and E.prjid=542and E.prjid=M.prjid and E.isno=M.isno and M.issdate<='2009-12-31'and ltrim(rtrim(isnull(e.csicode,''))) <> '' and u.userid = substring(E.updatedby,1,casewhen charindex('<->', E.updatedby)-1<=0then 1else charindex('<->', E.updatedby)-1 end ) ande.updatedon <dateadd(day, 0, cast(DATEPART(yyyy, getdate()) as varchar(5)) + '-' + cast(DATEPART(m, getdate()) as varchar(5)) + '-' + cast(DATEPART(d, getdate()) as varchar(5)))group by substring(E.updatedby,1,charindex('<->',E.updatedby)-1),e.updatedon
KH[spoiler]Time is always against us[/spoiler]