Solved

insert statement date/time conversion

Posted on 2011-09-08
2
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Results to Excel File 18 88
SSIS - how to skip a step if it is spinning indefinitely in a step? 14 41
Creating a View from a CTE 15 46
t-sql left join 2 31
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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