Hi everyone,here is my issue.
I am doing some calculations in stored procedure and display as below ...I want to add Basic,BasicDuty,CVD,Custom,AddDuty and display it as ActualCost
ProductName ProductCode Basic BasicDuty CVD Custom AddDuty ActualCost
Produc1 P1 4553 34 32 143 11 4553+34+32+143+11
How can i do this..help me out
Here's the actual proc
select ProductName,ChapterCode,ISNULL(@Dollarrate,0)*ISNULL(@INR,0) BASIC,
ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) CustomINR,
(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100) LCOST,
(((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100)) BASICDUTY,
((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100)+ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0))*DBO.DIVIDE(PM.CVD,100) CVD,
((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+
(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100)+ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0))*DBO.DIVIDE(PM.CVD,100))*DBO.DIVIDE(PM.Custom,100) Custom,
(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100)+(((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+
(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100)+ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0))*DBO.DIVIDE(PM.CVD,100)+((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+
((((ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0) * DBO.DIVIDE(PM.LCost,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)))*DBO.DIVIDE(PM.BASIC,100))+(ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0)) * DBO.DIVIDE(PM.LCost,100)+ISNULL(@Dollarrate,0)*ISNULL(@CustomINR,0))*DBO.DIVIDE(PM.CVD,100))*DBO.DIVIDE(PM.Custom,100))*DBO.DIVIDE(PM.SAD,100) ADDDUTY
FROM ProductMaster PM WITH(NOLOCK) where Productname=@ProductName