Skip to content

How to add characters in the results up to certain length in SQL

I need to add * symbols to make all records to 15 digits. What is the best way? Thanks, Answer Your other questions are tagged for SQL Server, so I will assume that database. SQL Server does not support rpad(), but you can use left() and replicate(): or: If col is not already a string, then you need to cast

How to move decimal places in SQL

I want to place a decimal between the first and second digit of the interest rate and keep 2 trailing after the decimal. How do I go about doing this? SELECT TOP 10 l.PARENTACCOUNT AS [Account Number]…