Solved

sql - decimal 2 digit

Posted on 2014-10-09
3
127 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

789 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