Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
When I try to execute below query I'm getting this error. I try with some changers in the date time format in server But still not luck.

Query :
SQL
INSERT INTO MissCall (QueueName,Phone,StartTime,EndTime,Duration) values('English','785135928','16/10/2014 3:20:21 PM','16/10/2014 3:20:26 PM','5')


Error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
Posted
Updated 23-Oct-14 18:34pm
v2

Try:
SQL
INSERT INTO MissCall (QueueName,Phone,StartTime,EndTime,Duration) values('English','785135928','2014-10-16 15:20:21','2014-10-16 15:20:26','5')
 
Share this answer
 
Comments
Soft009 26-Nov-14 9:07am    
I'm getting StartTime and EndTime from the variable. How can I convert it into the above format. This query is in the vbscript.
OriginalGriff 26-Nov-14 10:19am    
Pass the variables via a parameterised query; don't convert them to strings at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900