Hi friends,
I am doing a project which has calculations. In my front end, i have to display the result in a grid. So i thought i ll complete the steps in sql and bind it with the grid. I have two sp's which are calculationa and i have to merge both of them in a single sp using for loop. The sp's i have pasted below.!
for Onsite:
Alter procedure usp_PyramidCalculationOnsite
as
begin
select
A.ServiceID,Service,--,FTECnt,C.PT,D.Offshore,
(FTECnt*C.PT/100*D.Onsite/100) as PT,
Round((FTECnt*C.PAT/100*D.Onsite/100),1) as PAT,
Round((FTECnt*C.P/100*D.Onsite/100),1) as P,
Round((FTECnt*C.PA/100*D.Onsite/100),1) as PA,
Round((FTECnt*C.A/100*D.Onsite/100),1) as A,
Round((FTECnt*C.SA/100*D.Onsite/100),1) as SA,
Round((FTECnt*C.M/100*D.Onsite/100),1) as M,
Round((FTECnt*[SM+]/100*D.Onsite/100),1) as SM
from
(select
A.ServiceID,B.Service,A.IsScope,
10 as FTECnt
from
tblEstimateServices A,
tblServices B
where
IsScope > 0 and
EstimateID=827 and
VersionNo=1 and
A.ServiceID = B.ServiceID)A,tblDesignationReference C,tblOnsiteOffshoreRatio D
where
A.ServiceID = C.ServiceID and
Location='Onsite' and
ReferenceModel='Aggressive' and
A.ServiceID = D.ServiceID and
C.ServiceID = D.ServiceID
End
and for offshore its :
Alter procedure usp_PyramidCalculationOffshore
as
begin
select
A.ServiceID,Service,--,FTECnt,C.PT,D.Offshore,
(FTECnt*C.PT/100*D.Offshore/100) as PT,
Round((FTECnt*C.PAT/100*D.Offshore/100),1) as PAT,
Round((FTECnt*C.P/100*D.Offshore/100),1) as P,
Round((FTECnt*C.PA/100*D.Offshore/100),1) as PA,
Round((FTECnt*C.A/100*D.Offshore/100),1) as A,
Round((FTECnt*C.SA/100*D.Offshore/100),1) as SA,
Round((FTECnt*C.M/100*D.Offshore/100),1) as M,
Round((FTECnt*[SM+]/100*D.Offshore/100),1) as SM
from
(select
A.ServiceID,B.Service,A.IsScope,
10 as FTECnt
from
tblEstimateServices A,
tblServices B
where
IsScope > 0 and
EstimateID=827 and
VersionNo=1 and
A.ServiceID = B.ServiceID)A,tblDesignationReference C,tblOnsiteOffshoreRatio D
where
A.ServiceID = C.ServiceID and
Location='Offshore' and
ReferenceModel='Aggressive' and
A.ServiceID = D.ServiceID and
C.ServiceID = D.ServiceID
end
==========================================
In my front end, i have to show then like this,
ServiceID FTE Offshore Onsite
P PAT PA PT A SA M SM P PAT PA PT A SA M SM
I have to show the result under this grid..
Please help me on how to proceed furthur with the for loop query..
Thanks in advance.
.