Inserting a 000000 date value in a field
Posted on 2011-02-22
I have an ascii file that i am inserting the records into a MS SQL (2008) table. The Birthdate field is sometimes a valid date in mmddyy format which I am using Substring to put it into yymmdd format for the field in SQL. The problem is when the date field in the ascii file is all zeros 000000 (mmddyy) Insert script will not run, I get an error saying "Conversion failed when converting date adn/or tiem from character string." How can I get the ascii date value of 000000 accepted into the SQL date field? The field in SQL is a date field and allows nulls?