List:General Discussion« Previous MessageNext Message »
From:Keith C. Ivey Date:February 5 2002 11:36pm
Subject:Re: deleting var="0.1"
View as plain text  
On 5 Feb 2002, at 15:11, Dan Nelson wrote:

> I assume var1 is a float in the first case?  Due to rounding 
> issues, the "=" operator will almost never work on fractions.
> Use the primary key to select which record to delete, or use a 
> number range (var1 BETWEEN 1000.009 AND 1000.1001).

Matthias Hoffmann should also consider whether FLOAT is the right 
type.  The fact that he's trying to see whether the value is exactly 
equal to 1000.1 suggests that it's not, since floats aren't good for 
storing exact values.  If the column represents some sort of code, 
then a string type (like VARCHAR) is probably what he wants.  If it's 
a currency amount, then an integer type stored as the smallest unit 
(cents, for example) will work much better.

Fodder for the idiotic filter: sql,query

-- 
Keith C. Ivey <keith@stripped>
Washington, DC
Thread
deleting var="0.1"Matthias Hoffmann5 Feb
  • Re: deleting var="0.1"Dan Nelson5 Feb
    • Re: deleting var="0.1"Keith C. Ivey6 Feb
  • Re: deleting var="0.1"Kyle Hayes5 Feb