参数数据类型float对于格式函数的参数2无效。
select 'Purchase',Format(sum(case when Project='Dammam Central' then (Price) end) ,'##,##0.#0') as [Dammam Central],
Format(sum(case when Project='Dammam East' then (Price) end) ,'##,##0.#0') as [Dammam East],
Format(sum(case when Project='Hadeed FPH' then (Price) end) ,'##,##0.#0') as [Hadeed FPH],
Format(sum(case when Project='Hadeed MTO' then (Price) end) ,'##,##0.#0') as [Hadeed MTO],
Format(sum(case when Project='IBN Rushd' then (Price) end) ,'##,##0.#0') as [IBN Rushd],
Format(sum(case when Project='Jeddah SMPT' then (Price) end) ,'##,##0.#0') as [Jeddah SMPT],
Format(sum(case when Project='Jubail JCP' then (Price) end) ,'##,##0.#0') as [Jubail JCP],
Format(sum(case when Project='Dammam Central' then (Price) end),
sum(case when Project='Dammam East' then (Price) end) +
sum(case when Project='Hadeed FPH' then (Price) end) +
sum(case when Project='Hadeed MTO' then (Price) end) +
sum(case when Project='IBN Rushd' then (Price) end) +
sum(case when Project='Jeddah SMPT' then (Price) end)+
sum(case when Project='Jubail JCP' then (Price) end) ,'##,##0.#0') as [Total]
from purchase