Please convert this to linq query using vb
select sum(tr.AmountBeforeTax) as AmountBeforeTax ,sum(tr.Nett_Total) as NettTotal,l.Name,tl.taxName,tl.Gl_Account
from transactions tr inner join locations l on
tr.Location_id = l.ID inner join taxlists tl on
l.taxscheme_ID = tl.taxscheme_id
group by l.ID,l.Name,tl.taxname,tl.gl_Account
Loading
Jaganathan BantheswaranPosted Jul 21, 2011, 9:18 AM
Try like this,
var result = from tr in transactions
join l in locations on tr.Location_ID equals l.ID
join tl in taxlists on l.taxscheme_ID equals tl.taxscheme_id
groub tr by new { l.ID,l.Name,tl.taxname,tl.gl_Account } into grouped
select new
{
AmountBeforeTranx = grouped.Key.AmountBeforeTax.Sum(),
NettTotal = grouped.Key.NettTotal.Sum(),
Name = grouped.Key.Name,
TaxName = grouped.Key.taxName
Account = grouped.Key.Gl_Account
};