1
Answer

Average Calculation

Ramco Ramco

Ramco Ramco

2y
593
1

Hi

  I have below query & i want to get average by dividing total no days by total no of entries

  select sum([TotDays]),month([InvoiceDate]),year([InvoiceDate]) FROM [Sales] 
  where [InvoiceDate] between DATEADD(month, -12, GETDATE()) and GETDATE()
  group by year([InvoiceDate]),month([InvoiceDate])

Thanks

Answers (1)