Solved

insert statement date/time conversion

Posted on 2011-09-08
2
182 Views
Last Modified: 2012-05-12
I am trying to insert a line in a table that has two fields combined with date and time.
i am getting the following error what do I do to resolve.

Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
0
Comment
Question by:Amanda Walshaw
2 Comments
 
LVL 5

Accepted Solution

by:
zvytas earned 500 total points
ID: 36508763
The following should work:

INSERT INTO Table (...) VALUES ('2011 09 09 12:15:45')

i.e. date format should be yyyy MM dd HH:mm:ss
0
 
LVL 3

Expert Comment

by:Srm74
ID: 36509098
Can you post the tsql you are having troubles with ??
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question