Solved

sql server 8.0 - Function and format to get 2 digits after decimal points

Posted on 2006-06-13
1
1,037 Views
Last Modified: 2008-01-09
Hi Experts,
Can someone please help me with this basic question. I need to get 2 digits after decimal point in sql server. Doing the following in sql query analyzer;
select 10/3 gives me 3.  I need to get 3.33
If I do the calculations inside the stored procedure, same thing happens and I do not get digits after decimal. Thanks
0
Comment
Question by:uzairp
1 Comment
 
LVL 6

Accepted Solution

by:
TDSnet earned 250 total points
ID: 16898246
SELECT CONVERT(DECIMAL(10,2), CONVERT(REAL, 10) / 3)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

774 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