Question

What is the way to code this query with Linq to Entities (method based syntax)?

select sum(ceiling((PackSize)/50)) from table1;

Thanks

Was it helpful?

Solution

var query = context.Table1.Sum(x => Math.Ceiling(x.PackSize/50));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top