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
VulpesPosted Nov 21, 2012, 6:10 PM
var query = from tblService in dataContext1
David SmithPosted Nov 21, 2012, 8:33 PM
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));