?
Solved

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

Posted on 2006-06-13
1
Medium Priority
?
1,070 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 1000 total points
ID: 16898246
SELECT CONVERT(DECIMAL(10,2), CONVERT(REAL, 10) / 3)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Make the most of your online learning experience.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Progress

807 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