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
Discussions

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
๐ŸŒ 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
๐ŸŒ forums.sqlteam.com
0
August 12, 2021
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
๐ŸŒ 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
๐ŸŒ r/SQL
8
1
February 17, 2015
๐ŸŒ
Spiceworks
community.spiceworks.com โ€บ programming & development โ€บ databases & queries
Changinf the date format in sql server like YYMMDD - Databases & Queries - Spiceworks Community
April 3, 2008 - I am using SELECT CONVERT(VARCHAR(10),GETDATE(),112) it is giving 20080403; but i want result in YYMMDD format. iโ€™ve tried one more command i.e. SELECT CAST(DATEPART(yy,GETDATE()) AS VARCHAR(20)),but it is again giving mโ€ฆ
๐ŸŒ
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.
๐ŸŒ
Medium
medium.com โ€บ towardsdev โ€บ how-to-use-the-convert-function-for-datetime-conversion-in-ms-sql-server-f480cdc885f5
How to Use the CONVERT() Function for DateTime ...
October 21, 2024 - Data Validation: Ensure date strings conform to the expected formats before processing. The CONVERT() function in MS SQL Server is a versatile tool for DateTime conversion, allowing you to manipulate and format dates as needed.
Find elsewhere
๐ŸŒ
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
๐ŸŒ
SQL Easy
sql-easy.com โ€บ learn โ€บ how-to-convert-datetime-to-date-in-sql-server
How to Convert DATETIME to DATE in SQL Server Effortlessly - SQL Knowledge Center
February 9, 2024 - SELECT CONVERT(varchar, getdate(), 101) as FormattedDate; This converts the current datetime to a varchar type with a mm/dd/yyyy format, using the style code 101.
๐ŸŒ
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 ...