I am really struggling transferring this SQL to linq below, can someone help me
SELECT tblService.FilledByID, SUM(refServiceType.ServiceTypeAvgHours) AS TotalHrs
FROM (tblService INNER JOIN
refServiceType ON tblService.ServiceType = refServiceType.ServiceTypeID)
WHERE (tblService.ServiceStatus <> 5) AND (tblService.ServiceStatus <> 7) AND (tblService.ServiceDateStart BETWEEN NOW() AND NOW() - 30)
GROUP BY tblService.FilledByID
Loading

VulpesRank #55 · 29.2K reputationPosted Nov 21, 2012, 1:10 PM EST
var query = from tblService in dataContext1
David SmithRank #999 · 2K reputationPosted Nov 21, 2012, 3:33 PM EST
I have another sql query, I almost got the hang of the group and joining in linq, how would I convert this sql to linq below
SELECT tblService.FilledByID, Count(tblService.ServiceID) AS NumOfServices
FROM tblService INNER JOIN refServiceType ON tblService.ServiceType = refServiceType.ServiceTypeID
WHERE (((DatePart("ww",[ServiceDateStart]))=DatePart("ww",DLookUp("ServiceDate","sysUser"))) AND ((Year([ServiceDateStart]))=Year(DLookUp("ServiceDate","sysUser"))) AND ((tblService.ServiceStatus)<>5 And (tblService.ServiceStatus)<>7))
GROUP BY tblService.FilledByID
HAVING (((tblService.FilledByID) Is Not Null));