I have this data as varchar '00072330'. How to convert it to decimal code that looks like "723.30" in SQL Server 2008?
Try the following:
declare @data as varchar(8) set @data = '00072330' print cast(@data as decimal) / 100
It:
SELECT CAST('00072330' AS INT)/100.0
... give you:
723.300000
The value .0 is important, otherwise SQL Server will do the math with an integer.
Source: https://habr.com/ru/post/1720478/More articles:WebMethod возвращается как String (без тегаWhat is the meaning of `void func () throw (type)`? - c ++Информирование пользователя о заполнении DataGridView - vb.netCan I group by account in LINQ? - c #How can I insert a widget into mainwindow created by Qt? - qtAdvantage of data type identifier versus NSString in Objective-C? - memoryJava: удаление памяти на диск - javaasp.net mvc 2 preview 2 and Spark - asp.net-mvcWindbg - Discovery of characters needed for emergency reset - symbolsReal-time notification of iPhone from the server, without using Apple push notification - iphoneAll Articles