SELECT (SUM(ME) / SUM(STE)) * 24 FROM myTable WHERE DateInserted >= DATEADD(day, -90, GetDate())
SELECT SUM(ME)/SUM(STE)*24 FROM myTable WHERE DateNew>=DATEADD(YourDay,-90,GetDate())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)