Ronak Patel

Ronak Patel

  • NA
  • 84
  • 13.3k

DateTime Format In SQL

Mar 11 2016 5:05 AM
pls Resolve this Issue..
 
DECLARE @Stdate varchar(20)
SET @Stdate = CONVERT(VARCHAR(20), '31/03/2016', 111)
SELECT (DATEADD(MONTH, 12 , @Stdate)) AS EndDate
 
Error
 
Msg 242, Level 16, State 3, Line 34
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
 
 

Answers (6)