Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Analyzer - Dividing Issue Help 1

Status
Not open for further replies.

nerdalert1

Programmer
Nov 4, 2004
92
US
Hi all. Why in SQL 2K query analyzer when I run this:

SELECT 2000/8000 AS TEST

I am getting 0 back instead of 0.25?
 
These are two integer values so the result will be a rounded integer. IE .25 will round down to 0.

If you did:

SELECT (2000*1.0)/8000 AS TEST

you would get your desired result

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top