[Solved] Split the decimal place from a number using sql [closed]


You can use left() function with charindex() :

with t as
(
 select 5.083 as nr
)
select left(nr,charindex('.',nr)-1) as Carton,
       nr - left(nr,charindex('.',nr)-1) as Loose
  from t;

Carton  Loose
5       0.083

Demo

solved Split the decimal place from a number using sql [closed]