是否有可能在沒有計算的情況下投射變量?CAST變量爲FLOAT無操作?
像這樣:
CAST(SUBSTRING(interestRate, PATINDEX('%[^0 ]%', interestRate + ' '), LEN(interestRate)) AS FLOAT Interest_Rate
因爲我不斷收到錯誤。但如果我的專欄是這樣的:
((CAST(SUBSTRING(interestRate, PATINDEX('%[^0 ]%', interestRate + ' '), LEN(interestRate)) AS FLOAT) /100)/12) monthlyInterestRate
我沒有得到任何錯誤。有人可以解釋嗎?新手在這裏。
「我不斷收到錯誤」指定哪個錯誤會有幫助嗎?目前在FLOAT之後有一個缺失的「)」。 – dnoeth