Singe Data Type (1 Viewer)

SteveMcL

New member
Local time
Today, 13:16
Joined
Jul 10, 2014
Messages
6
I came across something interesting this morning, and haven't been able to find anything on it

I was querying a field which was search a field set as a Single data type,
and I was not able to use a direct equivalence ([lbs]=2) but had to use
the Like operator ([lbs] Like '2').

This would imply that the Single data type is not a true number.

Does anyone have some insight on this?
 

GinaWhipp

AWF VIP
Local time
Today, 15:16
Joined
Jun 21, 2011
Messages
5,900
Hmm, never saw that happen. Can you post the SQL View of the query here, might lend some insight into what is happening. Though could it be that it's like 2.0001 and so, in fact, does not equal 2 but really greater than 2?
 

SteveMcL

New member
Local time
Today, 13:16
Joined
Jul 10, 2014
Messages
6
I don't think we'll be able to track this one down.

I did retype the 2 into the table field, suspecting the same thing, but getting the same result.

However, I haven't been able to replicate the issue as I changed the number type of the field to Double, changing the values that existed before.

SELECT tblTable.Field FROM tblTable WHERE (((tblTable.Field)=2));
 
Last edited:

GinaWhipp

AWF VIP
Local time
Today, 15:16
Joined
Jun 21, 2011
Messages
5,900
Hmm, well I made a new field in a table and set the Data Type as a Single and did this...

Code:
SELECT Sales.SNO, Sales.Item, Sales.[Serial Start], Sales.[Serial End], Sales.lbs
FROM Sales
WHERE (((Sales.lbs)=2));
...and it retrun all the one that has a *2*. So, perhaps Access was having a bad day? :eek:
 

Users who are viewing this thread

Top Bottom