Solved

T-SQL truncating decimal places

Posted on 2006-11-27
2
1,627 Views
Last Modified: 2008-03-10
i pulling data (numbers) that have 5 decimal places (5204.34000 for example).  these are actually dollar amounts. When i run a query i want to truncate the last 3 decimal places, but only in the results, not in the actual table.

So basically when i look at the results, i want to see 5204.34, but i dont  actually want the values changed in the table (so the table would still have 5204.34000).

 how do i do that?
0
Comment
Question by:sammaell
[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

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 18020749
Hi sahnias,


select cast( round (UrColumn, 2) as numeric(10,2))

Cheers!
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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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.

733 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