@Status varchar(50)=null
select
x.name,
--x.Status => this status column name should change according to parameter passed
(case when @status='Success' then x.status as 'SuccessCount'
else 'FailCount' end)
from tblabc x
how to proceed...?
thanks in advance...,
Loading
Amit ChoudharyPosted Dec 26, 2012, 7:22 AM
Select SC, SN, DT, @Period as Period, ATT.A1
From ATT
Where SC = '9'
and DT = DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
and case @period
when 'att.a1' then att.a1
when 'att.a2' then att.a2
when 'att.a3' then att.a3
when 'att.a4' then att.a4
when 'att.a5' then att.a5
when 'att.a6' then att.a6
when 'att.a7' then att.a7
end = 'T'