Ramco Ramco

Ramco Ramco

  • 440
  • 3.4k
  • 516k

Sql Query to Linq

Nov 20 2022 3:26 AM

Hi

  I have below Sql query & i want to convert it to LInq

SELECT SUM([Total Days]) AS 'TotalDays', SUM([Total Days]) / COUNT([Entry Date]) AS Average, DATENAME(Month, MAX([Entry Date])) AS MonthName, YEAR([Entry Date]) AS 'Year'
FROM     dbo.View_Capex_LevelWiseStatus
WHERE  ([Entry Date] BETWEEN DATEADD(month, - 12, GETDATE()) AND GETDATE())
GROUP BY YEAR([Entry Date]), MONTH([Entry Date])

Thanks


Answers (2)