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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ROUND Munbers in a col.

Status
Not open for further replies.

bugzLue

IS-IT--Management
Feb 27, 2001
57
0
0
US
I have a Column that has $ values and i need to round it off to the second decimal from $25.36844444 to $25.37.

This is what I have tried and a few other ways that are not working. PLEASE HELP

SELECT DISTINCT CAST (mx.member AS BIGINT) Member, mxstreet, mxextra, sxcntsw, ROUND((sxbal),2) AS sxbal,

I am running SQL 2000 server. I have tried doing it on my sql 7.0 server as well. PLEASE PLEASE HELP

Thank you
Greg

I am new to this only been doing SQL for about 4 months.
 
try to convert the sxbal to a numeric data type

SELECT DISTINCT CAST (mx.member AS BIGINT) Member, mxstreet, mxextra, sxcntsw, ROUND(CAST(sxbal as real),2) AS sxbal,


try it i think it will work
 

Convert to Decimal data type rather than Real. Real is approximate and not all value can be precisely represented. Decimal is exact. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top