Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 avg number of rows on datemodifed column

Author  Topic 

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2011-10-19 : 00:28:28
Hi All,

I have result set which return the data for 1 year based on Date_modified column (datatype: datetime).

I need to make average based on each month how do we do this in SQL server 2005.



Thanks,
Gangadhara MS
SQL Developer and DBA

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2011-10-19 : 00:35:12
Average is based on sum of records for each month/ 20 working days

Thanks,
Gangadhara MS
SQL Developer and DBA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-19 : 05:32:23
group by datepart(mm,date_modifed) and take avg()

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -