Null in Datetime field

  • I am trying to change field type from 'char' to 'datetime', the enterprise manager gives

    error message stating

    "- Unable to modify table.

    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

    [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

    I have 'null value for that field in all records.

    Please copy me at jocollin@czn.com also.

  • Have you tried checking if there is a default or FK bound? Cascading updates?

    Steve Jones

    steve@dkranch.net

  • I would guess that you've got a value that SQL can't translate to a date. Try making a separate col that is a datetime, then update it with the contents of your char field. That would eliminate any questions about fkeys or cascades.

    Andy

  • Thanks guys. The suggestion by Andy Warren worked. I recreated a new one, deleted the old column and the datetime field is working now.

  • Glad we could help.

    Steve Jones

    steve@dkranch.net

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply