Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Number to Decimal

$
0
0

Hi All,

This is easy but I'm posting because of time issue. This is my excel formula 

IF(LEN(O6)>3,CONCATENATE(LEFT(O6,3),".",RIGHT(O6,LEN(O6)-3)),O6) This just check the length and if length is greater than 3 it will put a decimal point.

I'm now want to write in SQL But missing some syntax. Can you guyz help me.Thanks.

Declare @icd10 varchar(10)='A0056'
Select @icd10,
CASE when LEN(@ICD10)>3 
THEN concat(LEFT(@ICD10,3),".",RIGHT(@ICD10,LEN(O2)-3)),@ICD10) ELSE @icd10

Viewing all articles
Browse latest Browse all 23857

Trending Articles