Solved

I need help with percentages in my SQL Server Query

Posted on 2014-02-09
2
370 Views
Last Modified: 2014-02-09
How do I turn varchar value 05600000 into the percentage value 5.6 in my SQL Server 2012 query?  Thank you very much in advance.

mrotor
0
Comment
Question by:mainrotor
2 Comments
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 200 total points
ID: 39845554
Something like this perhaps:
DECLARE @Value varchar(20) = '05600000'
SELECT CAST(@Value AS numeric(18,2)) / 1000000
0
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 300 total points
ID: 39845555
SELECT CAST('05600000' AS DECIMAL(18,2))/100000

Open in new window

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now