database - Issues on update/insert a field that the data type is SINGLE -


i can't believe in happening , simple prove issue. need execute code below access db using dao.

create table table1(field1 single)  insert table1 (field1) values(9.99) 

then

select * [table1] 

the result

field1 = 9,98999977111816

that big deal because if insert 2000 rows , sum field, value starting far , far expected sum of values.

adding more information,

currency have fieldsize = 15 store, single have fieldsize = 7 store, need use single because storage limit important me.

solutions good. speculate lose time. true not deserve down votes.

and issue, have same problem? documented issue? lets talk abou behavior, me?

currency uses 15 bytes store

no, doesn't. uses 8 bytes store , accurate 15 digits left of decimal point (ref: here).

single uses 7 bytes

no, uses 4 bytes. however, floating-point representation , hence has limitations of any floating-point data type described here:

is floating point math broken?

if storage space required use currency real problem should take @ overall design of application. example, if concerned 2gb limit access table (database file) perhaps access database engine no longer right tool job.

addendum:

thanks @hansup reminding limit 1gb prior access 2000, , op indeed using access 97. after ~20 years, maybe it's time upgrade more recent version of access.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -