Solved

sql - decimal 2 digit

Posted on 2014-10-09
3
125 Views
Last Modified: 2014-10-30
How can I convert it from
6.522
11.794

to

6.52
11.79
0
Comment
Question by:VBdotnet2005
3 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 40372015
The context to when you are trying to do this would help and some sql code that you are using.

i.e. are you trying to do this as part of a stored procedure, function or dynamic sql

and posting the sql you do have would help so we don't have to re-invent the wheel
0
 

Author Comment

by:VBdotnet2005
ID: 40372018
Thank you Paul. I figured it out.

CAST([Pord Cost] AS decimal(10, 2)) AS Prod_Cost
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 250 total points
ID: 40372282
Try
select cast(6.522 as decimal(12,2))

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

Suggested Solutions

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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