• savycara (7/23/2013)


    I am trying to convert 20114 which is stored as varchar to datetime but I am getting the following error

    Syntax error during explicit conversion of VARCHAR value '20114' to a DATETIME field.

    Can some one help me in solving this?

    This value can be interpreted as multiple date values (see possible dates below). What date is defined by the value "20114"?

    2020-01-14 (200114 / 20200114)

    2020-11-04 (201104 / 20201104)

    2002-01-14 (020114 YMD / 20020114)

    2014-01-02 (020114 DMY / 02-01-2014)

    2014-02-01 (020114 MDY / 01-02-2014)

    Because additional digits are required to get a valid date notation, the conversion fails. You need to add additional prefixing to get a valid numeric value of at least 6 but preferably 8 digits.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **