You actually have multiple problems - the fact that the column is stored as a string (varchar) and the format that is stored is regional specific (DD/MM/YYYY).
If the language on the server is US English - the format DD/MM/YYYY will fail to convert to a valid date. US English format is MM/DD/YYYY โฆ Answer from jeffw8713 on forums.sqlteam.com
GeeksforGeeks
geeksforgeeks.org โบ sql โบ sql-query-to-convert-datetime-to-date
SQL Query to Convert DateTime to Date in SQL Server - GeeksforGeeks
Explanation: In this example, we first CONVERT() the current DateTime to a varchar string with format 23 (YYYY-MM-DD), then use SUBSTRING() to get only the date part. Converting DateTime to Date in SQL Server is a straightforward process that can help simplify our queries by focusing only on the date portion of the value.
Published ย July 23, 2025
t sql - Convert a SQL Server datetime to a shorter date format - Stack Overflow
I have a datetime column in SQL Server that gives me data like this 10/27/2010 12:57:49 pm and I want to query this column but just have SQL Server return the day month and year - eg. 2010 10 27 or More on stackoverflow.com
Convert string to date
Hi all this has really baffled me for a few days and am seeking help. I am trying to handle strings from a free format field and either convert them to a date in the format of "dd/mm/yyyy" or if they are not in this format then simply display the text verbatim. More on forums.sqlteam.com
t sql - How to convert a "dd/mm/yyyy" string to datetime in SQL Server? - Stack Overflow
SELECT FORMAT(CONVERT(DATETIME, ... SELECT CONVERT(DATETIME, '23/07/2009', 103) OUTPUT --------------- '23/07/2009 00:00:00' ... I myself have been struggling to come up with a single query that can handle both date formats: mdy and dmy. However, you should be ok with the third date format - ymd. ... Actually, I don't believe SQL Server uses ... More on stackoverflow.com
How to convert a 5 digit number to a date
Simples.. What excel is giving you is the number of days since the epoch (day zero). SELECT dateadd(D,42026,0) Adding 42026 days to day zero gives 2015-01-24. Hope thats some help. More on reddit.com
Videos
09:05
SQL | How to Convert Date / Time Formats ? | Convert | Format - ...
How to Format Dates in SQL Server using Convert and Format
01:26
How to Convert DATE Columns to dd.mm.yyyy Format in SQL Server ...
04:43
Format Date in SQL Query - YouTube
01:47
Successfully Convert Date Formats in SQL Server - YouTube
07:32
Date format style in convert function With MS-SQL Server - YouTube
W3Schools
w3schools.com โบ sql โบ func_sqlserver_convert.asp
SQL Server CONVERT() Function
String Functions: ASCII CHAR_LENGTH ... STR_TO_DATE SUBDATE SUBTIME SYSDATE TIME TIME_FORMAT TIME_TO_SEC TIMEDIFF TIMESTAMP TO_DAYS WEEK WEEKDAY WEEKOFYEAR YEAR YEARWEEK Advanced Functions: BIN BINARY CASE CAST COALESCE CONNECTION_ID CONV CONVERT CURRENT_USER DATABASE IF IFNULL ISNULL LAST_INSERT_ID NULLIF SESSION_USER SYSTEM_USER USER VERSION SQL Server ...
Microsoft Learn
learn.microsoft.com โบ en-us โบ sql โบ t-sql โบ functions โบ cast-and-convert-transact-sql
CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learn
SQL Server provides the two digit year cutoff configuration option to change the cutoff year used by SQL Server. This allows for the consistent treatment of dates. We recommend specifying four-digit years. 3 Input when you convert to datetime; output when you convert to character data. 4 Designed for XML use. For conversion from datetime or smalldatetime to character data, see the previous table for the output format.
SQL Shack
sqlshack.com โบ sql-convert-date-functions-and-formats
SQL Convert Date functions and formats
May 21, 2021 - We do face many such scenarios when we do not have a date format as per our requirement. We cannot change table properties to satisfy each requirement. In this case, we need to use the built-in functions in SQL Server to give the required date format. We have the following SQL convert date and Time data types in SQL Server.
SQL Tutorial
sqltutorial.org โบ home โบ sql date functions โบ sql convert string to date functions
SQL Convert String to Date Functions: CAST() and TO_DATE()
April 4, 2020 - SELECT CAST('180101' AS DATE); Code language: SQL (Structured Query Language) (sql) ... Oracle and PostgreSQL provide the TO_DATE() function that converts a string to date based on a specified format.
InfluxData
influxdata.com โบ home โบ how does date conversion work in sql? | influxdata
How Does Date Conversion Work in SQL? | InfluxData
October 6, 2023 - So, a SQL database with a date and time of "08/15/2023 23:20:30" can be read as invalid for a format of "DD/MM/YYYY" as there is no "15" month in the Gregorian calendar. --Wrong format Declare @date_time_value varchar(100)= '08/15/2023 23:20:30' select CONVERT(datetime2, @date_time_value, 103) as Date;
W3Schools
w3schools.com โบ sql โบ sql_alter.asp
SQL ALTER TABLE Statement
String Functions: ASCII CHAR_LENGTH ... STR_TO_DATE SUBDATE SUBTIME SYSDATE TIME TIME_FORMAT TIME_TO_SEC TIMEDIFF TIMESTAMP TO_DAYS WEEK WEEKDAY WEEKOFYEAR YEAR YEARWEEK Advanced Functions: BIN BINARY CASE CAST COALESCE CONNECTION_ID CONV CONVERT CURRENT_USER DATABASE IF IFNULL ISNULL LAST_INSERT_ID NULLIF SESSION_USER SYSTEM_USER USER VERSION SQL Server ...
MSSQLTips
mssqltips.com โบ home โบ sql date format examples using convert function
SQL Date Format Examples using SQL CONVERT Function
September 26, 2025 - I want to convert a Text Field which is saving the Data in String into a Date field. The value stored is in the below format. Value Stored = 66028 Actual Value (or) Desired Output = 10-11-2021 (dd-mm-yyyy) ... you could create another table with the mapping and then join to that table based on the day of the month to return your A, B, C, etc. values. ... Hello, i am beginner in sql i have one task of conversion of date like.
SQLTeam
forums.sqlteam.com โบ transact-sql
Convert string to date - Transact-SQL - SQLTeam.com Forums
August 12, 2021 - Hi all this has really baffled me for a few days and am seeking help. I am trying to handle strings from a free format field and either convert them to a date in the format of "dd/mm/yyyy" or if they are not in this foโฆ
Microsoft Learn
learn.microsoft.com โบ en-us โบ sql โบ t-sql โบ data-types โบ date-transact-sql
date (Transact-SQL) - SQL Server | Microsoft Learn
The following code shows the results of converting a date value to a datetime2(3) value. DECLARE @date AS DATE = '1912-10-25'; DECLARE @datetime2 AS DATETIME2 (3) = @date; SELECT @date AS '@date', @datetime2 AS '@datetime2(3)'; Here's the result set. @date @datetime2(3) ---------- ----------------------- 1912-10-25 1912-10-25 00:00:00.000 ยท Conversions from string literals to date and time types are allowed if all parts of the strings are in valid formats.
Experts Exchange
experts-exchange.com โบ articles โบ 12315 โบ SQL-Server-Date-Styles-formats-using-CONVERT.html
SQL Server Date Styles (formats) using CONVERT() | Experts Exchange
October 3, 2013 - Some new Format sample can be found here ... DELIMITED STARTS PATTERN STYLED DATE SYNTAX STYLE LENGTH YYYY YYYY MM DD 20010223 convert(varchar, your_data_here ,112) 112 8 YY YY MM DD 010223 convert(varchar, your_data_here ,12) 12 6 slash YYYY YYYY MM DD 2001/02/23 convert(varchar, your_data_here ,111) 111 10 slash YY YY MM DD 01/02/23 convert(varchar, your_data_here ,11) 11 8 slash MM MM DD YYYY 02/23/2001 convert(varchar, your_data_here ,101) 101 10 slash MM MM DD YY 02/23/01 convert(varchar, your_data_here ,1) 1 8 slash DD DD MM YYYY 23/02/2001 convert(varchar, your_data_here ,103) 103 10 sl
Mimo
mimo.org โบ glossary โบ sql โบ convert-function
SQL CONVERT Function: Syntax, Usage, and Examples
Include the style code if you need to control the format of the resulting stringโstyle 101 formats the date as mm/dd/yyyy. Use the SQL CONVERT function when the data types between columns or values donโt match but still need to be compared or used together.
Quest Blog
blog.quest.com โบ home โบ various ways to use the sql convert date function
SQL CONVERT date formats and functions
April 26, 2024 - DECLARE @InputDate DATETIME = '2020-12-08 15:58:17.643' SELECT 'd' AS [FormatCode], 'Short Date Pattern' AS 'Pattern', Format(@InputDate, 'd') AS 'Output' UNION ALL SELECT 'D' AS [FormatCode], 'Long Date Pattern' AS 'Pattern', Format(@InputDate, 'D') AS 'Output' UNION ALL SELECT 'f' AS [FormatCode], 'Full Date/Time pattern (Short Time)' AS 'Pattern', Format(@InputDate, 'f') AS 'Output' UNION ALL SELECT 'F' AS [FormatCode], 'Full Date/Time pattern (Long Time)' AS 'Pattern', Format(@InputDate, 'F') UNION ALL SELECT 'g' AS [FormatCode], 'General Date/Time pattern (Short Time)' AS 'Pattern', Forma
Top answer 1 of 9
133
The last argument of CONVERT seems to determine the format used for parsing. Consult MSDN docs for CONVERT.
111 - the one you are using is Japan yy/mm/dd.
I guess the one you are looking for is 103, that is dd/mm/yyyy.
So you should try:
SELECT convert(datetime, '23/07/2009', 103)
2 of 9
15
Try:
SELECT convert(datetime, '23/07/2009', 103)
this is British/French standard.
W3Schools
w3schools.com โบ sql โบ sql_dates.asp
Date Functions in SQL Server and MySQL
String Functions: ASCII CHAR_LENGTH ... STR_TO_DATE SUBDATE SUBTIME SYSDATE TIME TIME_FORMAT TIME_TO_SEC TIMEDIFF TIMESTAMP TO_DAYS WEEK WEEKDAY WEEKOFYEAR YEAR YEARWEEK Advanced Functions: BIN BINARY CASE CAST COALESCE CONNECTION_ID CONV CONVERT CURRENT_USER DATABASE IF IFNULL ISNULL LAST_INSERT_ID NULLIF SESSION_USER SYSTEM_USER USER VERSION SQL Server ...