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
Solved

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

Posted on 2006-06-13
1
1,045 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

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 115
Non-recursive backtracking, using a stack 1 169
tvirtualstringtree freeze when load too manny images 10 71
Selenium and Interactive Data Language 3 42
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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…

792 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