hi guys,
I have a requirements to sum up the qty and at the same time get the number of days at the same time get the aveerage days.
I have already the query but could not get the exact requirements.
here is the ddl and sample result..thanks in advance
create table #sample (wrkctrid nvarchar(35), createddate datetime, lastupdate datetime, asustatus int) go insert into #sample select 'Assembly 2','2013-07-10','2013-07-19',5 union all select 'Assembly 2','2013-07-14','2013-07-23',5 union all select 'Assembly 2','2013-07-17','2013-07-23',1 union all select 'Assembly 2','2013-05-14','2013-05