Link to home
Start Free TrialLog in
Avatar of jason bradway
jason bradway

asked on

Add decimal point in output of Text Field in SQL View

I have completed a table that list all of my ICD10 codes utilized in my office, they are specifically stored in my table as a text field without a decimal point so that it can be used for exportation into my billing program.  However I have an oversight agency that wants the data of the ICD10 Diagnosis codes WITH the decimal point.  I currently have a view that compiles all of my data together so that it can be exported with the proper order and number of fields into a pipe delimited file.  Subsequently this is uploaded into their server.

My diagnosis fields need to be converted in the view to include a decimal point after the third character if the data has more than three characters.

I am looking to make the following work:
F89 to F89
F1120 to F11.20
F29 to F29
F39820 to F39.820
F2245 to F22.45
and so on.

There are 65,000 codes stored within the table and any might have to be reported out that do not have the decimal placement.  Billing programs do not allow the decimal and yet I need to have it to be in compliance with oversight agencies.

Therefore I am hoping that there might be a SQL Convert or Cast statement that can be used to solve the issue.  Does anyone have suggestions to make this work without restructuring all the data fields within the tables.
Avatar of mankowitz
mankowitz
Flag of United States of America image

select left(icd,3) + "." + substring(icd, 3,99)
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jason bradway
jason bradway

ASKER

Worked great, good thing I only have to type it in once and have it work.  Thank you