I have a database that I receive every month that I simply import through CSV into MYSQL. I don't worry about preserving any old database entries, so I just overwrite the old database with the new entries monthly.
I want to be able to sort through the database by month, however I currently need to import the date field as VARCHAR, or risk having to manually convert tons of entries to fit the formatting of the MYSQL date field.
I would like to take the entries stored in the 'Expiration Date' field and be able to run a query that will convert them to a MYSQL date format and then write them to a new column named 'Expiration_Converted' so that I can then run date functions to show me all dates from a month, year, etc.
I know about the STR_TO_DATE function in MYSQL, however I'm not quite sure how to pull this off. I'm writing everything in PHP.
Any advice would be greatly appreciated.
Thanks!