Good Afternoon All,I have the following code where if i use only one insert statement it works. But when I try to do more than one it fails. I am not understanding why. Use TESTGOCREATE TABLE YourTable (PersonID INT , TreatmentID INT , StartDate DATETIME , EndDate DATETIME , TreatmentType INT);GO --PersonID, TreatmentID, StartDate, EndDate, TreatmentTypeDElETE FROM YourTable;INSERT INTO YourTable VAlues (1,1,'01/01/2008','01/02/2008',3) goINSERT INTO YourTable Values( 1,2,'22/01/2008','28/02/2008',1)goINSERT INTO YourTable Values( 1,3,'01/04/2008','31/12/2008',2)goINSERT INTO YourTable Values( 2,4,'01/01/2008','31/12/2008',1)goINSERT INTO YourTable Values( 2,5,'23/06/2008','31/12/2008',3)goINSERT INTO YourTable Values( 3,6,'01/01/2008','28/02/2008',1)goINSERT INTO YourTable Values( 3,7,'05/11/2008','23/12/2008',2)go
The error specifics are: quote:
Msg 242, Level 16, State 3, Line 1The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated.