Recently, I was trying to insert some date and time values into one of the SQL server tables named USAOrders, which contains 2 columns of the datetime datatype. After executing the insert query, I got this error.
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
I was executing the below insert query to insert one record to the USAOrders table.
insert into USAOrders values('02-21-2025 6:10:00 PM','01-01-2025 12:00:00 AM');After executing the above query, I got the above error as shown in the screenshot below.

Solution
The problem here was with the time zone setting. So I was trying to insert the datetime column value with DD-MM-YYYY format. What I have done here is, I tried inserting the date time value with the MM-DD-YYYY format.
Now, the query I execute is below.
insert into USAOrders values('02-21-2025 6:10:00 PM','01-01-2025 12:00:00 AM');After executing the above query, I got the expected output as shown in the screenshot below and this time the data got inserted successfully without any error.

You may also like the following articles.
- Operand Type Clash: Date Is Incompatible With Int
- SQL Server conversion failed when converting date and/or time from character string.
- SQL Server Convert Datetime to Date
- SQL Server DateTime To Date
After working for more than 15 years in the Software field, especially in Microsoft technologies, I have decided to share my expert knowledge of SQL Server. Check out all the SQL Server and related database tutorials I have shared here. Most of the readers are from countries like the United States of America, the United Kingdom, New Zealand, Australia, Canada, etc. I am also a Microsoft MVP. Check out more here.