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

Rounding

Status
Not open for further replies.

krotha

Programmer
Nov 5, 2000
116
US
When I query a field from the Query Analyzer I get
0.57999999999999996. But from EM it shows 0.58. How shall I get 0.58 from the query analyzer.
 
cast(YourField as numeric(12,2)) or the like.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Sounds like your field is a float or real datatype. Do not use these datatypes if you want an exact number as they are always approximations. Use numeric or decimal instead.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top