SQL query to insert datetime in SQL Server

0 votes

Using the SQL query below, I want to add a datetime value to a table (SQL Server).

insert into table1(approvaldate)values(18-06-12 10:34:09 AM);

But I get this Error msg:

Incorrect syntax near '10'.

 Can someone please help me with this?

Aug 29 in Database by Kithuzzz
• 12,240 points
90 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

How to make a query with group_concat in sql server ?

I am aware that the Group Concat ...READ MORE

Aug 28 in Database by Kithuzzz
• 12,240 points
42 views
0 votes
0 answers

How to create a table from select query result in SQL Server 2008

I tried to build a table from ...READ MORE

Sep 2 in Database by Kithuzzz
• 12,240 points
38 views
0 votes
0 answers
0 votes
1 answer

How to upsert (update or insert) in SQL Server 2005

Try to check for existence: IF NOT EXISTS ...READ MORE

answered Sep 18 in Database by narikkadan
• 20,880 points
21 views
0 votes
1 answer

How to format datetime in SQL SERVER

In SQL Server 2012 and up you ...READ MORE

answered Sep 18 in Database by narikkadan
• 20,880 points
21 views
0 votes
1 answer

SQL Server replaces LEFT JOIN for LEFT OUTER JOIN in view query

You are getting the joins confused and ...READ MORE

answered Feb 4 in Database by Neha
• 8,920 points
185 views
0 votes
0 answers

Calculate time difference in minutes in SQL Server

I require the minutes-based time difference between ...READ MORE

Aug 13 in Database by Kithuzzz
• 12,240 points
115 views
0 votes
0 answers

How can I select the first day of a month in SQL?

I only need to choose the given ...READ MORE

Aug 14 in Database by Kithuzzz
• 12,240 points
26 views
0 votes
0 answers

How to return only the Date from a SQL Server DateTime datatype

SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part ...READ MORE

Sep 6 in Database by Kithuzzz
• 12,240 points
30 views
0 votes
1 answer

How to extract only the year from the date in sql server 2008?

To obtain the year from the given ...READ MORE

answered Sep 15 in Database by narikkadan
• 20,880 points
45 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP