从varchar转换为decimal或numeric [英] convert from varchar to decimal or numeric
问题描述
你好,我在处理转换时遇到问题
hello , i have a problem dealing with convertion
所以我有一个包含金额的列 使用类型varchar(因为我从一个excal中提取它,所以我带来varchar类型)
so i have a column that contain amount with type varchar ( because i extract it from an excal so i came with varchar type )
示例234,32 / -6 / 1,234,213所以当我尝试转换时我遇到了问题它是十进制数 我首先使用此表达式处理空值
example 234,32 / -6 / 1,234,213 so i have a problem when i try to convert it in decimal number i first treat the null value by using this expression
replace(REPLACE(ISNULL([CA CIF Net])|| [CA CIF Net ] ==""?
" 0" ;: [CA CIF Net],",""")
之后我使用派生列进行转换
但我不行,它给了我例如23432
我认为像这样的数字 1,234,213 会导致我的问题
i think that number like this one 1,234,213 causes me problem
任何想法请
谢谢
推荐答案
用于 234,32 / -6 / 1,234,213 什么是所需的输出?
这篇关于从varchar转换为decimal或numeric的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!