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?
Sqlite date issue
sqlite
Related Question
- How to Add Carriage-Return/Line-Feeds Without Starting a New Row in SQLite Import
- Import .db files/tables into sqlite database
- SQLite – Update Table Schema with Correct Datatype
- SQLite database becomes corrupt
- How to reduce size of a large SQLite database with series data
- How to Use Trigger for Addition Between Tables in SQLite
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.