Solved

put 2 digits after decimal in sql

Posted on 2007-03-19
1
4,203 Views
Last Modified: 2010-05-18
Hi there,

           I am using this average function where I am getting 18.526000. How would I truncate so that the average value comes out 18.52. This means I want to have only two digits after the decimal.

SELECT Round(AVG(CONVERT(decimal, DateDiff(d, Date_To_Media, Date_Given_to_Acctg))),2) AS Average
  FROM [Discrepancy]
0
Comment
Question by:siddhuoops
[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 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 18751536
SELECT CAST( Round(AVG(CONVERT(decimal, DateDiff(d, Date_To_Media, Date_Given_to_Acctg))),2) as NMERIC(10,2) )  AS Average
  FROM [Discrepancy]
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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