• try this. The problem comes from the fact that fan01 does not physically exist it is a named output of the query.

    select t.* from

    (

    SELECT

    fc.no, fc.nome,

    'FANO1' = SUM(Case When year(datalc)=2010 Then fc.ecred Else 0 End),

    'Dif' = SUM(Case When year(datalc)=2010 Then fc.ecred Else 0 End)-SUM(Case When year(datalc)=2009 Then fc.ecred Else 0 End)

    FROM fc(nolock)

    left join fo on fc.fostamp=fo.fostamp

    ) t

    WHERE

    t.fano1 <> 0

    Group By

    t.no, t.nome

    Order By

    t.nome

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.