I am converting all written LINQs to the SQL procedures in my application but here I get stuck and it made me to write my problem here.
Below mentioned code is my LINQ:
Var Tdate= From T in JobProcessedInfo
Join D in WeeklyReport on T.JobId=D.JobId
Join B in BatchDetails on B.BatchId=T.BatchId
Where T.JobAmount>0 And T.ReviewId = 80
Group By T.BatchId,B.BatchCode into amt=SUM(T.JobAmount)
Select T.ProcessedDate
In above LINQ , in Group By clause there is a INTO word before amt=SUM(T.JobAmount)
. I am not getting how i can convert this into SQL statement query.
Here what I created in SQL by following above LINQ:
Select T.ProcessedDate From JobProcessedInfo T
JOIN WeeklyReport D on T.JobId=D.JobId
JOIN BatchDetails B on B.BatchId=T.BatchId
Where T.JobAmount>0 And T.ReviewId = 80
Group By T.BatchId,B.BatchCode
Here i am missing SUM(T.JobAmount)
because I am not getting where and how to add it in SQL query.
Please help me to understand and to make proper SQL query of above mentioned LINQ.