Converting VARCHAR Type Date to dd.mm.yyyy in SQL Server
Hello everyone. In this article, I will try to give information about converting VARCHAR type date as dd.mm.yyyy in SQL Server.
In SQL Server, in some cases, you may want to convert the VARCHAR type date to dd.mm.yyyy.
You can easily do this using the code below.
DECLARE @tarih VARCHAR(30) = '5.06.2023'
SELECT
CONVERT(VARCHAR, CONVERT(DATE, @tarih, 104), 104)
When you run the above code, you will see a result similar to the one below.
As you can see, we have converted the VARCHAR type date as dd.mm.yyyy.
Good luck to everyone in business and life.