PRB: DATEADD Doesn't Work When Using a Variable as a Date (47048)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 6.5
- Microsoft SQL Server 6.5 Service Pack 1
- Microsoft SQL Server 6.5 Service Pack 1 and later
- Microsoft SQL Server 6.5 Service Pack 2 and later
- Microsoft SQL Server 6.5 Service Pack 3 and later
- Microsoft SQL Server 6.5 Service Pack 4 and later
- Microsoft SQL Server 6.5 Service Pack 5 and 5a
- Microsoft SQL Server 6.5 Service Pack 5a
- Microsoft SQL Server 7.0 Service Pack 1
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q47048 SYMPTOMS
The use of a variable as a date in the DATEADD command can result
in an error message of "Msg 242, Level 16, State 0:," stating
that an out of range conversion was attempted.
WORKAROUND
This problem can be corrected by ensuring the variable is
correctly declared as datetime.
Modification Type: | Minor | Last Reviewed: | 3/14/2005 |
---|
Keywords: | kbprb KB47048 |
---|
|