Convert DD-Mon-YYYY to DD / MM / YYYY format

I need to convert dt_of_birth [varchar] (15) , which is in DD-Mon-YYYY format to DD/MM/YYYY .

dt_of _birth is specified in another table, and the conversion must be performed and stored in another table that has the same column name as dt_of_birth .

+6
source share
4 answers

Here

 SELECT convert(datetime, '23/10/2016', 103) -- dd/mm/yyyy 
+2
source

Try the following: -

  SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '23-Oct-2016', 13), 103); 

103 is for dd/mm/yyyy format

Link opens

+2
source

It will work

 SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '27-Jan-2011', 13), 103); 
+2
source

Try the following: -

INSERT INTO SecondTable (Column1)

SELECT CONVERT (VARCHAR (10), CAST (dt_of_birth AS DATETIME), 103) FROM FirstTable

0
source

All Articles