BUG: DATETIME Convert May Set NULL to Jan 1, 1900 12:00AM (186830)



The information in this article applies to:

  • Microsoft SQL Server 4.2x
  • Microsoft SQL Server 6.0
  • Microsoft SQL Server 6.5

This article was previously published under Q186830
BUG #: 17819 (SQLBUG_65)

SYMPTOMS

Any local variable of fixed length for which there is an implicit or explicit conversion to SMALLDATETIME will inadvertently convert NULL to the default date Jan 1, 1900 12:00AM.

A fixed length binary variable will also convert NULL to the default date when the IMPLICIT conversion is to DATETIME.

WORKAROUND

To work around this problem, use variables of variable length rather than fixed length.

STATUS

Microsoft has confirmed this to be a problem in SQL Server versions 4.2x, 6.0, and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Modification Type:MajorLast Reviewed:11/14/2003
Keywords:kbBug kbpending KB186830