B4J Question SQLITE dates

powerino

Active Member
Licensed User
Hello everyone, I would like to store dates in a sqlite table (in integer format) and then read the date from DATABASE and display it in my form (possibly also make SQL searches with BETWEEN). I can not find examples in the forum, can anyone tell me how to do it? thank you
 

Peter Simpson

Expert
Licensed User
Longtime User
@powerino yourself and other B4X developers need to also use Google for simple questions like this one. I read your first post and thought to myself, you can't find the answer on the forum from yesterday. I did a quick 1 minute Google search and the second or third result gave me the response the you put in your last post by using 'strftime' quick I've never come across before. I see that you have the answer now, but you would have gotten the answer yesterday if you would have done a quick Google search yourself.

SQLite search between dates:
SELECT * FROM test WHERE strftime('%Y-%m-%d', date) BETWEEN "11-01-2011" AND "11-08-2011"
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Also make sure check on page 16 too
https://www.b4x.com/guides/B4xSQLiteDatabase/?page=16


"You" (we) need to be able to handle both, because not always you are the creator of the DB.
Ya, we can do whatever we want to our DB.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…