I have a CSV file with dates that are in "3/8/2018 9:05:00 AM" format.
When the dates get pushed into a table with column type 'varchar(30)', it becomes "3/8/2018 9:05"
When the dates get pushed into a table with column type 'DATE', it becomes "0000-00-00"
I would like for my columns to be in DATE format so I can sort based on date. Do my CSV dates need to be in 'YYYY-MM-DD' format for this to work?
OR
Is there a way to change the 'Date' format in my SQL table to be in 'mm/dd/yyy hh:mi:ss' or just 'mm/dd/yyyy'?
Right now my only option seems to be to push the dates into SQL with varchar format as is, pull and convert all my dates to "YYYY-MM-DD" format and store them in an array, 'Alter' my column format to "DATE", and then push my array of formatted dates back into the newly altered "DATE" column.
Still new to SQL so any help would be greatly appreciated.