Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
i want to create a stored procedure to get monthly attedance on the basis of total number of persent out of working day .and working day also will count in month after removing total number of holiday ,can anybody help me ?
Posted

1 solution

Please check below example:

SQL
declare @Results table (
    Id int not null,
    Answer int not null,
    NoOfComments int not null
)
insert into @Results (Id,Answer,NoOfComments) values
(18,      1,        2),
(19,      2,        0),
(20,      3,        0),
(21,      4,        0),
(22,      5,        1)

select *,((NoOfComments * 100.0) / SUM(NoOfComments) OVER (PARTITION BY (1))) as Pcnt
from @Results


* This is only example not a stored procedure
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900