【发布时间】:2015-09-04 11:35:11
【问题描述】:
我有这条线可以正常工作并将我的列变成一个数字
case when Auth_Amt LIKE '%DAY%' then cast(SUBSTRING(Auth_Amt FROM 1 FOR POSITION('/DAY' IN Auth_Amt) - 1) as numeric) when Auth_Amt LIKE '%TAX%' then cast(SUBSTRING(Auth_Amt FROM 1 FOR POSITION(' ' IN Auth_Amt) - 1) as numeric)
when Auth_Amt LIKE '%SCHG%' then cast(SUBSTRING(Auth_Amt FROM 1 FOR POSITION(' ' IN Auth_Amt) - 1) as numeric)
else 0
end as Amt_Day
我可以添加什么以使其也返回两个小数点。现在是整数带回来了。
【问题讨论】:
标签: sql-server-2008 casting numbers substring decimal