October 7, 2010 at 7:54 am
Hi,
Hi,
Please find the attachment and tell how to write query for genrating reports like that.
I am using below query to genrate reports
My reports should be for across last 4 weeks,3 weeks,2 weeks,1st week,2nd ,3rd,4th week.
With the below query i am able genrate reports for 1st week,2nd week,3rd week and 4th week.
Tell me how to generate reports for across last 4 weeks,3,2.
Across last 4 weeks includes Reports for all weeks combining
Declare @TotalEmployee int
Select @TotalEmployee=4
SELECT weekstartdate,
convert(varchar,dbo.FDiv(Count(Case When delta='0' Then EmpNo end),@TotalEmployee)*100)+'%' as 'No Delta',
convert(varchar,dbo.FDiv(Count(Case when delta>'0' and delta<='2' Then EmpNo end),@TotalEmployee)*100)+'%' as 'Within 2hrs',
convert(varchar,dbo.FDiv(Count(Case when delta>'2' Then EmpNo end),@TotalEmployee)*100)+'%' as 'Greater than 2'
FROM Test1
GROUP BY weekstartdate
October 7, 2010 at 9:12 am
I'm not entirely clear what you want, but there is a parameter for datepart that can give you the week of the year. You could include that in your query and then group/break by that value.
October 7, 2010 at 9:19 am
Hi,
Please find the attachment.How to genrate reports like that.
I have 4 weeks data based on this i need to generate reports for across last 4,3,2 weeks,1st,2nd,3rd,4th week.
Just give stored procedure structure on how to do that.
October 7, 2010 at 5:16 pm
naresh0407 93367 (10/7/2010)
Just give stored procedure structure on how to do that.
Fair warning and a bit of friendly advise... people are going to take strong exception to a written attitude like that whether you mean it the wrong way or not. I recommend you take a look at the first link in my signature line below and format your question in that manner to actually get help on this particular problem.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply