One of our users made an insert statement on the development server. The insert worked fine. However, when the same insert statement was executed on the production server, it found the error below:
Error: .Net SqlClient Data Provider Error Message: Converting a char data type for a date and time data type led to an out of range datetime value. Application completed.
The insert statement is below:
Insert into tbl_SeatWave_customers (Title ,FirstName ,Lastname ,EmailAddress ,HomeTelephone ,Address1 ,Address2 ,Address3 ,Town ,County ,Postcode ,BuyerOrSeller ,OrderID ,ListingID ,BestCallDateTimeFrom ,bestcalldatetimeto ,FAQAsked ,Comments ,CallOutcome ,Spare1 ,Spare2 ) Values('Mr' ,'Darren' ,'Piper' ,' bazzt27@hotmail.com ' ,'07825758328' ,'7 RUSSELL ROAD' ,'' ,'' ,'' ,'CLWYD' ,'LL18 3BS' ,'Other' ,'' ,'19/06/2009' ,'12:00' ,'' ,'Callers tickets have not yet arrived.' ,'Resolved' ,'Yes' ,'' )
The tbl_SeatWave_customers table has the following structure:
COLUMN_NAME DATA_TYPE COLUMN_DEFAULT NUID bigint NULL CallDateTime datetime (getdate()) Title nvarchar NULL FirstName nvarchar NULL LastName nvarchar NULL EmailAddress nvarchar NULL HomeTelephone nvarchar NULL MobileTelephone nvarchar NULL WorkTelephone nvarchar NULL Address1 nvarchar NULL Address2 nvarchar NULL Address3 nvarchar NULL Address4 nvarchar NULL Town nvarchar NULL County nvarchar NULL Postcode nvarchar NULL BuyerOrSeller nvarchar NULL OrderID nvarchar NULL ListingID nvarchar NULL BestCallDateTimeFrom datetime NULL BestCallDateTimeTo datetime NULL FAQAsked nvarchar NULL Comments nvarchar NULL Spare1 nvarchar NULL Spare2 nvarchar NULL Spare3 nvarchar NULL Spare4 nvarchar NULL Spare5 nvarchar NULL CallOutcome nvarchar NULL
My question is, what is the cause of this error and what is the resolution to fix it?