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, 2022 in Database by Kithuzzz
• 38,000 points
2,982 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, 2022 in Database by Kithuzzz
• 38,000 points
1,815 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, 2022 in Database by Kithuzzz
• 38,000 points
1,927 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, 2022 in Database by narikkadan
• 86,360 points
1,926 views
0 votes
1 answer

How to format datetime in SQL SERVER

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

answered Sep 18, 2022 in Database by narikkadan
• 86,360 points
2,768 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, 2022 in Database by Neha
• 9,020 points
2,763 views
0 votes
1 answer

Calculate time difference in minutes in SQL Server

SELECT  Diff = CASE DATEDIFF(HOUR, StartTime, EndTime)                     WHEN ...READ MORE

answered Oct 4, 2022 in Database by anonymous

edited Mar 5, 2025 2,499 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, 2022 in Database by Kithuzzz
• 38,000 points
1,824 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, 2022 in Database by Kithuzzz
• 38,000 points
1,484 views