formerpigeek

Query with a WHERE clause that contains a float value will fail

Discussion created by formerpigeek on Nov 11, 2009
Latest reply on Nov 13, 2009 by michaelh

Hello,

 

I have a problem executing a OLEDB query with a WHERE clause that contains a float value.

 

For example, I updated a tag's typicalvalue using the following command:

update classic set typicalvalue = 99.9 where tag ='test2'

 

The execution was successful. The typicalvalue of 'test2' was updated to 99.9. But when I selected this tag using the following command:

select * from classic where typicalvalue=99.9

 

I got nothing returned.

 

But when I executed the following command:

select tag, typicalvalue from classic

 

I got the row (tag='test2' and typicalvalue=99.9) returned. I tried to apply the same query to other float fields in the classic table such as compdev and excdev, the results were the same. It looks like the query could not correctly handle a float value in a where clause.

 

One interesting thing is, I occasionally tried to update a float value to 3.5 and this number worked. e.g.

update classic set typicalvalue = 3.5 where tag ='test2'
select * from classic where typicalvalue=3.5

 

I got the row (tag='test2' and typicalvalue=3.5) returned.

 

So I am very confused. Is this a bug? Please help.

 

Thanks!

 

Tina

Outcomes