Ramco Ramco

Ramco Ramco

  • 436
  • 3.4k
  • 546.2k

Average Calculation

Nov 19 2022 4:04 PM

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)