Python Forum
Find data using a period of time in SQLITE3 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Find data using a period of time in SQLITE3 (/thread-28641.html)



Find data using a period of time in SQLITE3 - SmukasPlays - Jul-27-2020

I'm doing a program to register products using SQlite3 so I need to generate some spreadsheets in Excell with some datas. One of the things that I need is to find the products by it's date of acquisition (that I will enter). However I don't have ideia how to do this search using a period of time. For example, I need all products acquired from January/7/2018 until December/23/2019 but I don't know a simple way to do it, neither I have found something like it. I'm new on Python and programming.


RE: Find data using a period of time in SQLITE3 - ndc85430 - Jul-30-2020

SQLite doesn't have a date type, so presumably you'll store the date as text and there are useful functions to work with dates (see section 2.2 here). You should be able to use those in a WHERE clause in your SELECT statement.


RE: Find data using a period of time in SQLITE3 - SmukasPlays - Jul-30-2020

(Jul-30-2020, 04:48 AM)ndc85430 Wrote: SQLite doesn't have a date type, so presumably you'll store the date as text and there are useful functions to work with dates (see section 2.2 here). You should be able to use those in a WHERE clause in your SELECT statement.

Oh thanks, it helped so much. I used BETWEEN and it worked. Thanks!