In SQLite, you can extract year, month and day from a date string. You simply need to use the substr(X, Y, Z) to extract the information that you want. It returns a substring of input string X that begins with the Y-th character and which is Z characters long. Y should start with 1.
-- Extract year. Output: 2019 SELECT substr("2019-06-27", 1, 4); -- Extract month. Output: 06 SELECT substr("2019-06-27", 6, 2); -- Extract day. Output: 27 SELECT substr("2019-06-27", 9, 2);