1
我有一個3列,這是這種格式,但我有一個客戶端需求是在以下格式。我把所有的東西都整理出來了,但是總是被卡住。將十進制(19,4)轉換爲字符串格式
pcn charge 100
court fee 15
solictors costs 00
total amount 115
Requirment
PCN charge - 7 (100) = 0010000
court fee - 5 (15) = 01500
solictors cost - 5 (0) = 00000
total amount - 8 (115)= 00011500 (I am not getting this value i get 00000115.)
這是我的查詢:
"RIGHT('00'+CAST(CAST(bat.PCN_Charge* 100.00 AS INT) AS VARCHAR(5)),7) as CLAIMAMT," +
"RIGHT('0'+CAST(CAST([CFee] * 100 AS INT) AS VARCHAR(5)),5) as CFEE," +
"RIGHT('00000'+CAST(CAST([Solictors Fees] AS INT) AS VARCHAR(5)),5)," +
"RIGHT('00000'+CAST(CAST(bat.PCN_Charge + [CFee] AS INT) AS VARCHAR(5)),8) as TotalAMT " +
謝謝多數民衆贊成我正在尋找..謝謝戈登... – smrithi