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

How to find values like 9.0949470E-13 and convert to zero? 2

Status
Not open for further replies.

steve728

Programmer
Mar 16, 2003
536
US
For some reason some of the balances in my table have values like 9.0949470E-13 (exponential values?). They're wreaking havoc. Please give me a sample of an update SQL statement that will change them to zero.

Thanks,

Steve
 
Update Table
Set Field = 0
Where Field < 0.0001

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
The field(s) in question is probably single or double? If so, I think what yo see is the result of errors in floating point arithmetic. For economical stuff, using the Currency datatype can give better precision. Could that be something to consider?

Some "geeky" reading
Roy-Vidar
 
You both get stars! gmmastros gave me the perfect code to
find and fix the problem. And you explained the possible source and solution to avoid the issue in the future.

You always come through!

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top