TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chetan Khokha
NA
13
8.1k
Linq query with group by & aggregate function like sum.
Jan 6 2014 4:01 AM
I want to create a linq dynamic query using group by and aggregate function like sum on different column of same table. i am using entity framework and using one table for one query.
like below but its showing error at runtime , its not correct way to right. Please tell me how to write a correct linq query.
Query --->
var varWeldingProgressReport = context.WeldingAuditProgressReports.Where(strWhereClause).Where(i => i.ReportDt >= dtDateFrom && i.ReportDt <= dtDateTo).Select("new(" + varAggregateColWeldingAudit + ")");
var temp = context.WeldingAuditProgressReports.GroupBy("ReportDt", "it").Select("new(Key as ReportDt, Sum(Progress) as Total)");
Reply
Answers (
3
)
how to create a temporary table in sql to linq query
Display progressbar and percentage (%) while querying a data