powerino Active Member Licensed User Feb 24, 2020 #1 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
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 Feb 27, 2020 #21 @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. Code: Copy SELECT * FROM test WHERE strftime('%Y-%m-%d', date) BETWEEN "11-01-2011" AND "11-08-2011" Upvote 0
@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. Code: Copy SELECT * FROM test WHERE strftime('%Y-%m-%d', date) BETWEEN "11-01-2011" AND "11-08-2011"
LucaMs Expert Licensed User Longtime User Feb 27, 2020 #22 aeric said: As for me, I store both. Click to expand... "You" (we) need to be able to handle both, because not always you are the creator of the DB. Upvote 0
aeric said: As for me, I store both. Click to expand... "You" (we) need to be able to handle both, because not always you are the creator of the DB.
aeric Expert Licensed User Longtime User Feb 27, 2020 #23 LucaMs said: Did you tried what Log(DateTime.Now) shows? It is a Long. https://www.b4x.com/guides/B4xSQLiteDatabase/?page=1 https://www.b4x.com/guides/B4xSQLiteDatabase/?page=15 https://www.sqlitetutorial.net/sqlite-date/ Click to expand... Also make sure check on page 16 too https://www.b4x.com/guides/B4xSQLiteDatabase/?page=16 LucaMs said: "You" (we) need to be able to handle both, because not always you are the creator of the DB. Click to expand... Ya, we can do whatever we want to our DB. Upvote 0
LucaMs said: Did you tried what Log(DateTime.Now) shows? It is a Long. https://www.b4x.com/guides/B4xSQLiteDatabase/?page=1 https://www.b4x.com/guides/B4xSQLiteDatabase/?page=15 https://www.sqlitetutorial.net/sqlite-date/ Click to expand... Also make sure check on page 16 too https://www.b4x.com/guides/B4xSQLiteDatabase/?page=16 LucaMs said: "You" (we) need to be able to handle both, because not always you are the creator of the DB. Click to expand... Ya, we can do whatever we want to our DB.
powerino Active Member Licensed User Feb 27, 2020 #24 You must never stop learning and you must always know as much as possible! Upvote 0