‘to_date’ is not a recognized built-in function name.

Recently, I was trying to convert a date to a specific format in SQL Server using the to_date function. But after executing the SQL query, I got this error.

‘to_date’ is not a recognized built-in function name.

I was trying to execute the following query.

SELECT to_date('20250526','YYYY-MM-DD');

After executing the above query, I got this error as shown in the screenshot below.

'to_date' is not a recognized built-in function name.

Solution

The problem here is that I was trying to use the to_date function in SQL, but actually, it is not available in SQL Server. It is available in Oracle, PostgreSQL, and other databases.

To do the same job in SQL Server, we can use the CONVERT() Function or CAST().

I have now executed the query below to achieve this.

SELECT CONVERT(DATE, '20250526', 112) AS ConvertedDate;

After executing the above query, I got the expected output as shown in the screenshot below.

'to_date' is not a recognized built-in function name

Video Tutorial

You may also like the following articles.