Microsoft – SQL Server – Error Message – The conversion of a varchar data type to a datetime data type resulted in an out -of-range value.

Background

Needing to move data among systems using BCP, but it is failing.

 

Error Message


Msg 242, Level 16, State 3, Server DEV, Procedure usp_Pull_Wrong, Line 17
The conversion of a varchar data type to a datetime data type resulted in an out
-of-range value.


To correct

To correct, verify data  is really a date.

 

      case 
             when isDate([returnDate]) = 1 then [returnDate]

             else null

      end as [returnDate]

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s