PRB: DATEADD Doesn't Work When Using a Variable as a DateLast reviewed: April 25, 1997Article ID: Q47048 |
The information in this article applies to:
- Microsoft SQL Server version 4.2 for OS/2
SYMPTOMSThe 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.
WORKAROUNDThis problem can be corrected by ensuring the variable is correctly declared as datetime.
MORE INFORMATION
Steps to Reproduce the Problem
declare @valdate datetime select @valdate=convert(datetime,'07/07/57') select dateadd(day,15,@valdate) go |
Additional query words: Transact-SQL
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |