Solved

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

Posted on 2006-06-13
1
1,060 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
[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 6

Accepted Solution

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

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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…
Introduction to Processes

688 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