Float数据类型中的参数无效

时间:2018-03-29 10:39:59

标签: sql-server

参数数据类型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

0 个答案:

没有答案