Solved

I need help with percentages in my SQL Server Query

Posted on 2014-02-09
2
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle Date 6 41
SQL Job Failed 6 31
Need split for SQL data 7 45
SSRS Deployed Reports Throws Not Supported in Edition of Reporting Services 12 18
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

734 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