?
Solved

I need to round down to nearest decimal in MS SQL View

Posted on 2008-06-22
1
Medium Priority
?
1,322 Views
Last Modified: 2008-06-22
I need a simple formula to round down numbers the the nearest 2 decimals in an MS SQL view.

What I do would look like this in Excel:
ROUNDDOWN(Sales;2)

I have tried with Round and I am able to round to 2 decimals but the problem is it rounds up rather than down.

45,145 should in my case be 41,14.
0
Comment
Question by:ecgabrielsen
[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
1 Comment
 
LVL 19

Accepted Solution

by:
LordOfPorts earned 2000 total points
ID: 21842557
Try deducting 0,001 from the value prior to using ROUND, e.g.:

SELECT ROUND(ColumnName - 0,001, 2) AS ROUNDDOWN
FROM TableName;

0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

800 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