SQLite Real Vs Double

Does it actually make a difference if I create a column as real or double? Are they both the same under-the-hood?



1 Like

I think this explains the problem I’ve had.
I’m storing a double value in a real column and later comparing the two using >= it’s not being returned.
I think the 15 significant digits is the issue.
I’m actually storing the “seconds from 1970” and Xojo returns fractions of a second as well Perhaps I should just store the rounded value.

store as integer if the number fits in an int64
or store as a string it will always fit.

it should fit in an int64 just fine. I have to do numeric comparisons on it in the DB, and I’m not confident I understand how that would behave if it were a string that was too large for the numeric limits.

I don’t think it matters if I store it as a numeric or int (as I declare it) does it?

Real and Double are the same in SQLite.

1 Like

Use INTEGER in SQLite, it can use up to 8 bytes to store the value. I dont really think you can use more than the “numeric limit” of 8,446,744,073,709,551,615

if you store the date as string its a query like date(fielda) >= date(fieldb)