I have a table that was imported from a csv file. Some of the records were not properly formatted. I have a varchar col called dba_use that has my text that will become my last_modified_date col data. Last_modified_date is a date col and I want to update it and convert the string data to dates in the process. But, when I hit a bad record that cant be converted by the str_to_date function, my update just fails. How can I test for invalid dates so i can skip them and get my update to work for the records with valid dates?
update 2008_2009 set last_modified_date = str_to_date(dba_use,'%m/%d/%Y %l:%i:%s %p') fails when it hits a dba_use column value that is not a possible date, but text like 'Windows 2000' etc.
thanks for any suggestions
update 2008_2009 set last_modified_date = str_to_date(dba_use,'%m/%d/%Y %l:%i:%s %p') fails when it hits a dba_use column value that is not a possible date, but text like 'Windows 2000' etc.
thanks for any suggestions