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

ID: Q186830


The information in this article applies to:
  • Microsoft SQL Server versions 4.2x, 6.0, 6.5

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.

Additional query words: Transact-SQL t-sql tran-sql trans-sql january

Keywords : SSrvTran_SQL kbbug6.50 kbbug4.21 kbbug6.00
Version : WINNT:4.2x,6.0,6.5
Platform : winnt
Issue type : kbbug


Last Reviewed: April 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.