Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    47

    Question Unanswered: Date Selection giving default '1/1/1900' for NULL values

    'XXX_DTE' is character type which wont take NULL.

    SELECT CONVERT(Datetime,XXX_DTE) FROM XXXX

    I get result as : 1/1/1900

    Why is it so.....

    What I expect is '0000-00-00 00:00:00.000'

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you are converting 0 to datetime? because that's what you got

    the "zero" date in sql server is 1/1/1900
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •