It counts the number of records approved by a user.
I want to modify it so if the count is less than 150, the count is increased 50%. If the count is 151-200, increase it 30%. If the count is 201-250 increase it 15%.
Thanks!
Declare @StartDate datetime, @EndDate datetime
Set @StartDate = ''
Set @EndDate = ''
select
f.review_user_id,
count(f.review_user_id) as 'Count',
(u.fname + ' ' + u.lname) as 'User',
'Type'= case
when f.wf_status_cn = 630 then 'Failed'
else 'Passed'
end,
@StartDate as 'Start',
@EndDate as 'End'
from cprx_workflow f
left join csuser u on f.review_user_id = u.user_id
where wf_status_cn in (630,920) and review_date >= @StartDate and review_date <= @EndDate + 1
group by f.review_user_id, u.fname, u.lname, f.wf_status_cn