forum

Home / DeveloperSection / Forums / Same queries displaying displaying different date in results?

Same queries displaying displaying different date in results?

Anonymous User 2024 30-Sep-2015

I have a problem with different results from two tables, both tables have three rows but different date formats here is the code:

sqlite> create table table1 (date text);
sqlite> create table table2 (date text);

Three rows with dates but the different formats:

sqlite> select * from table1;
28.09.2015
28.08.2015
29.08.2015
sqlite> select * from table2;
2015-09-28
2015-08-28
2015-08-29

My current date is:

sqlite> select date('now');
2015-09-29

Why do I have a different results for the next similar queries?

sqlite> select * from table1 where date < strftime('%d.%m.%Y', 'now',

'-1 day');
28.08.2015

sqlite> select * from table2 where date < strftime('%Y-%m-%d', 'now',

'-1 day');
2015-08-28
2015-08-29

Why first query don't returns '29.08.2015' too?


Updated on 27-May-2023
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By