?
Solved

I need help with percentages in my SQL Server Query

Posted on 2014-02-09
2
Medium Priority
?
390 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 800 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 1200 total points
ID: 39845555
SELECT CAST('05600000' AS DECIMAL(18,2))/100000

Open in new window

0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

650 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