Querying Numbers - Field Size = "Double"

K

Ken Valenti

I have a table that has the ID set as Number with field size Double (It's the
Key, required no duplicates).

I have two pieces of data
1492 (Some Integer)
39797.6002777778 (Some Date Stored as Number)

The SQL Code:
SELECT SupFields.ProjectData_ID FROM SupFields WHERE
(((SupFields.ProjectData_ID)=1492));

Returns 1492 But if I replace 1492 with 39797.6002777778, it returns nothing.

How can I get this SQL to work & return both numbers?
 
J

Jerry Whittle

When you get down to that many decimal points, Access can get flakey. You
might want to consider changing the data type to Decimal.

Please test this in a copy of the database before changing the table.
 
J

John W. Vinson

I have a table that has the ID set as Number with field size Double (It's the
Key, required no duplicates).

I have two pieces of data
1492 (Some Integer)
39797.6002777778 (Some Date Stored as Number)

The SQL Code:
SELECT SupFields.ProjectData_ID FROM SupFields WHERE
(((SupFields.ProjectData_ID)=1492));

Returns 1492 But if I replace 1492 with 39797.6002777778, it returns nothing.

How can I get this SQL to work & return both numbers?

Doubles are stored as a 64-bit binary number with an exponent and a mantissa;
they are approximations. Just as the fraction 1/7 cannot be displayed exactly
as a decimal, many decimal fractions cannot be displayed exactly as a Double.
You get about 14 digits of precision, and your example has 15, so you may be
at the limits of what a Double is capable of storing!

What kind of data requires a mix of integer and Double (Date/Time!?) fields
*as the Primary Key*?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top