Here's the SQL I would like run:
DECLARE @StartDt DATETIME, @EndDt DATETIME
SET @StartDt='2009-01-01'
SET @EndDt='2010-06-01'
SELECT
AVG(DATEDIFF(day, CreatedDt, CompletedDt))
AVG(DATEDIFF(day, CreatedDt, ComplianceDt))
FROM MyTable
WHERE RequestDt BETWEEN @StartDt AND @EndDt
Can this be expressed in Linq (C#) and have it all run on the database?