Solved

insert statement date/time conversion

Posted on 2011-09-08
2
179 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now