Replies: 11 comments 2 replies
-
What do you mean by "not work"? Do you get an error? Or you get wrong results? |
Beta Was this translation helpful? Give feedback.
-
the querys don´t retrieve data, but exist |
Beta Was this translation helpful? Give feedback.
-
Put your date between quotes, like:
|
Beta Was this translation helpful? Give feedback.
-
Yes I did but nothing i´m using " or simple ' but nothing |
Beta Was this translation helpful? Give feedback.
-
When usin SELECT cod_proyev, nro_obsproy, fecha_obs |
Beta Was this translation helpful? Give feedback.
-
And you're saying the same happens if you try it with Python? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I see. The problem lays in comparision method of fecha_obs and your argument. SQLite3 does not have real date or datetime types. It treats them as simple text. In addition, if you ever wanted to do some math on dates (subtracting/adding days), you would need to use date functions: https://sqlite.org/lang_datefunc.html |
Beta Was this translation helpful? Give feedback.
-
O let me see |
Beta Was this translation helpful? Give feedback.
-
Please note, that that also applies to any values stored in your |
Beta Was this translation helpful? Give feedback.
-
Details
Sorry for my english, i have a table with some records and a date field when i try to retrieve data using date field (fecha_obs).
Steps to reproduce
SELECT cod_proyev, nro_obsproy, fecha_obs
FROM bda_regobserv where cod_proyev = 'PPOD' and fecha_obs >=01/12/2020; this caser ok
SELECT cod_proyev, nro_obsproy, fecha_obs
FROM bda_regobserv where cod_proyev = 'PPOD' and fecha_obs =31/12/2020; not work
SELECT cod_proyev, nro_obsproy, fecha_obs
FROM bda_regobserv where cod_proyev = 'PPOD' and fecha_obs <=04/01/2021; not work
with python the same error don´t retrieve anything
Operating system
windows 10 64 bits
SQLiteStudio version
v3.2.1
Beta Was this translation helpful? Give feedback.
All reactions