Salut,
am si eu o nelamurire
de ce selectul urmator merge f bine cateva secunde
select ClientId, Dept, (-1)*sum(Soldl) as Sold
from table where Bdata = '20090331' and left(AccSint,4) in ('2021','2031','2042','2052','2061','2091','2312','2811','2821')
group by ClientId, Dept
iar daca am
declare @data varchar(8)
set @data = '20090331'
select ClientId, Dept, (-1)*sum(Soldl) as Sold
from table where Bdata = @data
and left(AccSint,4) in ('2021','2031','2042','2052','2061','2091','2312','2811','2821')
group by ClientId, Dept
merge f greu...zeci de minute
multumesc
alex.