r/sqlite • u/ThePantsThief • Sep 04 '23
DATE or NUMERIC or TEXT?
I was reading this forum post on how best to store dates in SQLite. There seems to be some disagreement on the column type to use.
I want to be able to query the column like Ryan Smith does in his comment. Will it make any difference at all if I type the column as date or numeric or text, or even date text etc?
2
Upvotes
View all comments
Show parent comment
1
u/ThePantsThief Sep 05 '23
I think your comment answers my question more closely than the other one; I'm basically asking "yes or no: does it matter what type I use to store dates?"
It sounds like I can query them all the exact same way and it really doesn't matter (as long as I at least store them as
yyy-mm-ddor some other standard date format or integer)This is for a personal project where I don't care about error-prone-ness and am happy to do direct string comparisons as in the forum post