try use PARSE t-sql function
SELECT PARSE(timestamp AS date USING 'Ru-RU') from table

Top answer 1 of 4
4
try use PARSE t-sql function
SELECT PARSE(timestamp AS date USING 'Ru-RU') from table

2 of 4
1
SQL Server is actually pretty flexible on converting date/times without a format. So, if you want to convert to a date/time, this works:
select convert(datetime, '06.07.2021 00:00:00')
If you are only looking at the date, though, you might want to limit to the first 10 characters. If you are certain that all the strings have valid dates, you can use 104 to convert the value:
select cast(date, left(datetime, 10), 104)
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 Functions · String Functions: ...
convert string to date
Based on your question, I believe insta_map_date is a varchar field. and based on the source data sample you provided, the date format matches with ISO8601. So you can use 126 or 127 as the style while converting to datetime. Try the following. ... For more information about SQL Server Date ... More on learn.microsoft.com
t sql - Sql Server string to date conversion - Stack Overflow
I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:S... 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
Solved: Convert string to date in table sql query
Hi all! I'm using a Table Transformer Macro to create a table where one column is the the first ten characters of the title string, which represent a date. Example: 2021-12-12 Super Important Meeting returns 2021-12-12 This part works fine. My remaining issue is that the result is not defined ... More on community.atlassian.com
Videos
SQL Server Tutorial
sqlservertutorial.net › home › sql server system functions › convert string to datetime
Convert String to Datetime in SQL Server
April 11, 2020 - In this tutorial, you will learn how to convert a string to a datetime in SQL Server using the CONVERT() and TRY_CONVERT() function.
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 685628 › convert-string-to-date
convert string to date - Microsoft Q&A
Based on your question, I believe insta_map_date is a varchar field. and based on the source data sample you provided, the date format matches with ISO8601. So you can use 126 or 127 as the style while converting to datetime. Try the following. ... For more information about SQL Server Date Formats, refer : https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver15
Top answer 1 of 16
368
Try this
Cast('7/7/2011' as datetime)
and
Convert(DATETIME, '7/7/2011', 101)
See CAST and CONVERT (Transact-SQL) for more details.
2 of 16
62
Run this through your query processor. It formats dates and/or times like so and one of these should give you what you're looking for. It wont be hard to adapt:
Declare @d datetime
select @d = getdate()
select @d as OriginalDate,
convert(varchar,@d,100) as ConvertedDate,
100 as FormatValue,
'mon dd yyyy hh:miAM (or PM)' as OutputFormat
union all
select @d,convert(varchar,@d,101),101,'mm/dd/yy'
union all
select @d,convert(varchar,@d,102),102,'yy.mm.dd'
union all
select @d,convert(varchar,@d,103),103,'dd/mm/yy'
union all
select @d,convert(varchar,@d,104),104,'dd.mm.yy'
union all
select @d,convert(varchar,@d,105),105,'dd-mm-yy'
union all
select @d,convert(varchar,@d,106),106,'dd mon yy'
union all
select @d,convert(varchar,@d,107),107,'Mon dd, yy'
union all
select @d,convert(varchar,@d,108),108,'hh:mm:ss'
union all
select @d,convert(varchar,@d,109),109,'mon dd yyyy hh:mi:ss:mmmAM (or PM)'
union all
select @d,convert(varchar,@d,110),110,'mm-dd-yy'
union all
select @d,convert(varchar,@d,111),111,'yy/mm/dd'
union all
select @d,convert(varchar,@d,12),12,'yymmdd'
union all
select @d,convert(varchar,@d,112),112,'yyyymmdd'
union all
select @d,convert(varchar,@d,113),113,'dd mon yyyy hh:mm:ss:mmm(24h)'
union all
select @d,convert(varchar,@d,114),114,'hh:mi:ss:mmm(24h)'
union all
select @d,convert(varchar,@d,120),120,'yyyy-mm-dd hh:mi:ss(24h)'
union all
select @d,convert(varchar,@d,121),121,'yyyy-mm-dd hh:mi:ss.mmm(24h)'
union all
select @d,convert(varchar,@d,126),126,'yyyy-mm-dd Thh:mm:ss:mmm(no spaces)'
W3Schools
w3schools.com › sql › func_mysql_str_to_date.asp
MySQL STR_TO_DATE() 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 Functions · String Functions: ...
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
For more information, see Nondeterministic conversion of literal date strings into DATE values. Starting with SQL Server 2012 (11.x), when using supplementary character (SC) collations, a CAST operation from nchar or nvarchar to an nchar or nvarchar type of smaller length won't truncate inside a surrogate pair.
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 - For example, to convert the string '10 Aug 2018' to a date value, you use the following statement: SELECT TO_DATE( '10 Aug 2018', 'DD MON YYYY' ) FROM dual; Code language: SQL (Structured Query Language) (sql) Notice that the date format must be corresponding to the date string as specified ...
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 ...
SQLServerCentral
sqlservercentral.com › forums › topic › convert-text-to-date-datatype
Convert Text to Date DataType – SQLServerCentral Forums
August 14, 2012 - Will you advise against using new non-standard FORMAT function in SQL2012? 2. CONVERT() is an expensive string formatting function, with all those old Sybase options; substring and concatenation are cheap, simple and fast. Fast? Can you prove, please? So far all test ever been done on this did show no difference. At the end, to convert string datatype into date datatype, engine uses CASTing in both cases!
DataCamp
datacamp.com › doc › mysql › mysql-str-to-date
MySQL STR_TO_DATE() Function: Usage & Examples
Here, the function converts '2023/12/10 14:30:00' into a date and time object, interpreting the format as 'Year/Month/Day Hour:Minute:Second'. SELECT STR_TO_DATE('Saturday, Dec 10 2023', '%W, %b %d %Y'); This example demonstrates converting a string with a different date format 'Saturday, Dec ...
DotFactory
dofactory.com › sql › convert-string-to-datetime
SQL Convert String to DATETIME
CONVERT and TRY_CONVERT can convert string values to datetime. CONVERT returns an error when a conversion error occurs. TRY_CONVERT returns NULL when a conversion error occurs.
Ai2sql
builder.ai2sql.io › blog › how-to-convert-string-to-date-sql
How to Convert String to Date in SQL (All Databases) | AI2SQL
1 week ago - -- CAST (simplest for ISO format): SELECT CAST('2026-03-12' AS DATE); SELECT '2026-03-12'::DATE; -- PostgreSQL shorthand -- TO_DATE for custom formats: SELECT TO_DATE('03/12/2026', 'MM/DD/YYYY'); SELECT TO_DATE('12-Mar-2026', 'DD-Mon-YYYY'); SELECT TO_DATE('March 12, 2026', 'Month DD, YYYY'); -- TO_TIMESTAMP for datetime strings: SELECT TO_TIMESTAMP('2026-03-12 14:30:00', 'YYYY-MM-DD HH24:MI:SS'); -- Format patterns: -- YYYY = 4-digit year MM = month DD = day -- HH24 = 24-hour MI = minute SS = second -- Mon = abbreviated month Month = full month · Tip: PostgreSQL's :: cast operator is the quickest way: '2026-03-12'::DATE. Use TO_DATE only for non-ISO formats. SQL Server uses CONVERT with style codes, or TRY_CONVERT for safe conversion that returns NULL on failure.
SQLines
sqlines.com › sql-server-to-postgresql › convert_datetime
CONVERT - String to Datetime - SQL Server to PostgreSQL Migration - SQLines Tools
-- Convert string to datetime SELECT TO_TIMESTAMP('12/28/2022 11:13:31', 'MM/DD/YYYY HH24:MI:SS'); # 2022-12-28 11:13:31+03 · When you convert CONVERT function to TO_TIMESTAMP you have to map the SQL Server style to the appropriate format string in PostgreSQL:
SQLServerCentral
sqlservercentral.com › forums › topic › convert-string-mmddyyyy-to-a-date
Convert string MMDDYYYY to a date – SQLServerCentral Forums
December 20, 2018 - I am not sure why you wouldn't do this in SSIS - it can be done using a derived column transformation quite easily and insures that the data is in a standard format that SQL will process as a date automatically. In the connection manager for that field - define it as a string with 10 characters (then end result you will want).
StarRocks
docs.starrocks.io › reference › sql functions › date and time › str_to_date
str_to_date - Converts a string into a DATETIME value
MySQL > select str_to_date('2014-12-21 12:34:56', '%Y-%m-%d'); +--------------------------------------------------------------+ | str_to_date('2014-12-21 12:34:56', '%Y-%m-%d') | +--------------------------------------------------------------+ | 2014-12-21 | +--------------------------------------------------------------+ Example 3: Convert the input "200442 Monday" into a DATE value.