Sqlite date issue

sqlite

I currently have a CSV file uploaded into a sqlite 3.9.0 database with a column as Period that contains date in M/D/YYYY format as TEXT. I want to do some conditional operations on the database based on dates. I am unable to recognize them as dates. How do I recognize them as dates and do the operations?

Best Answer

The date values must be in one of the supported date formats before you can do most operations on them.

You should configure whatever program that generates the CSV file to output the dates in a proper format. Alternatively, write a script to convert the values. If neither is possible, you could convert them with SQL statements, but SQLite does not have many string functions, so this would be not as easy.