score:1

i've taken the liberty of beatifying your tsql a little.

the last two join conditions appear malformed to me so this tsql can not be parsed.

select
                  [t].sanadid
                , [t].date
                , [a].id [accid]
                , [a].fullid
                , [a].name
                , sum([t].debit) [totaldebit]
                , sum([t].credit) [totalcredit]
     from
                dbo.finnaccount [a1] 
         left outer join
                dbo.finnaccount [a]
                    on [a1].parentid = [a].id
         right outer join
                dbo.finntrans [t]
         left outer join
                dbo.finnaccount [a2] 
                    on [a].accid = [a2].id 
                    on [a1].id = [a2].parentid
     where 
                 [t].fpid = 7
         and 
                 [a2].acclevel = 3
     group by
                   [t].sanadid
                 , [t].date
                 , [a].id
                 , [a].name
                 , [a].fullid  
         having 
                 [t].sanadid = 1 

score:2

you can look here: http://www.hookedonlinq.com/outerjoinsample.ashx as an example of the left outer join. and you can always swap tables to get either left or right


Related Query

More Query from same tag