Link to home
Start Free TrialLog in
Avatar of jaxrpc
jaxrpc

asked on

Microsoft RDLC report

Hi,

How do i make a sub total of a field for every group in table? example for data grouped by name, for every name i want to get the total number of days he is absent.

thanks.
Avatar of Sreedhar Vengala
Sreedhar Vengala
Flag of Australia image

Do you need SQL part to get the result set based on your condition
Sum(GroupBy(name),absentperiod);
do able with linq:
var orders =
        from o in OrderDetails
        group o by o.OrderID into oID
        select new {Category = oID.Key, TotalUnitsInStock = oID.Sum(o=>o.Quantity)};
        
orders.Dump();

SQL:

SELECT SUM(CONVERT(Int,[t0].[Quantity])) AS [TotalUnitsInStock], [t0].[OrderID] AS [Category]
FROM [Order Details] AS [t0]
GROUP BY [t0].[OrderID]

using OrderDetails table from Northwind

ASKER CERTIFIED SOLUTION
Avatar of jaxrpc
jaxrpc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial