Python Forum
Find data using a period of time in SQLITE3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find data using a period of time in SQLITE3
#1
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.
Reply
#2
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.
Reply
#3
(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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question in this code, I input Key_word, it can not find although all data was exact Help me! duchien04x4 3 971 Aug-31-2023, 05:36 PM
Last Post: deanhystad
  Basic SQL query using Py: Inserting or querying sqlite3 database not returning data marlonbown 3 1,303 Nov-08-2022, 07:16 PM
Last Post: marlonbown
  get data from excel and find max/min Timmy94 1 1,077 Jul-27-2022, 08:23 AM
Last Post: Larz60+
  what will be the best way to find data in txt file? korenron 2 1,125 Jul-25-2022, 10:03 AM
Last Post: korenron
  Real time data satyanarayana 3 20,106 Feb-16-2022, 07:46 AM
Last Post: satyanarayana
  How to read rainfall time series and insert missing data points MadsM 4 2,123 Jan-06-2022, 10:39 AM
Last Post: amdi40
  In linear time, find the maximum sum of all possible contiguous subarrays Exsul1 29 9,024 Nov-07-2021, 08:39 AM
Last Post: DPaul
  Find string between two substrings, in a stream of data xbit 1 2,113 May-09-2021, 03:32 PM
Last Post: bowlofred
Smile Set 'Time' format cell when writing data to excel and not 'custom' limors 3 6,195 Mar-29-2021, 09:36 PM
Last Post: Larz60+
  find the header location in a .bin file without reading the whole file at a time SANJIB 0 2,186 Mar-05-2021, 04:08 PM
Last Post: SANJIB

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020