+ 1
SQLite query to return records earlier than a certain year?
I am trying to come up with an SQL query to return all the records earlier than a certain year with SQLite using DB Browser. I can't seem to come up with the right regex expression to use for filtering only the year from a row for comparison, below is the query am using. It is returning 0 records please help. SELECT * FROM EMPLOYEES WHERE strftime('%Y', HireDate)<2003; I am trying to get all records where the HireDate which is a column is earler than 2003, please help.
3 Answers
+ 1
SELECT * FROM EMPLOYEES WHERE DATE_FORMAT('%Y',HireDate)<2003
+ 1
Thanks Vaclav but I already got the answer, I used cast as integer and it worked
0
đ