在 sql server 2008 中将 varchar 转换为十进制

2021-09-10 00:00:00 sql tsql sql-server-2008 sql-server

我将此数据设为 varchar '00072330'.在 SQL Server 2008 中,如何将其转换为类似于723.30"的十进制?

I have this data as varchar '00072330'. How do I convert it to a decimal that looks like '723.30' in SQL Server 2008?

推荐答案

试试这个:

declare @data as varchar(8)
set @data = '00072330'
print cast(@data as decimal) / 100

相关文章