Hi all,
I have a problem for the SUM and REPLACE function, the SQL script will as below,
select DISTINCT
CapitalForecastID
,Description
,BudgetOwnerName
,CapitalForecastCostPerUnit
,' + @SelectColNames + '
SUM(' + @SelectColNames + ') AS TotalCost
for the @SelectColNames parameter will return the result as
[Q1 '10] ,[Q2 '10] ,[Q3 '10] ,[Q4 '10] ,
My Question as below,
(1) How can i SUM all the Quarters as above with the REPLACE symbol (+)
(2) Since from the statement above, i have symbol (') and (,). So i cant write the correct way on that.
Please advice.
Thanks :)