Solved

T-SQL truncating decimal places

Posted on 2006-11-27
2
1,575 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
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now