I need to convert dt_of_birth [varchar] (15)
which is in the format DD-Mon-YYYY
to DD/MM/YYYY
.
我需要将格式为DD-Mon-YYYY的dt_of_birth [varchar](15)转换为DD / MM / YYYY。
dt_of _birth
is specified in different table and the conversion had to be done and stored in another table which has the same column name as dt_of_birth
.
dt_of _birth在不同的表中指定,转换必须完成并存储在另一个与dt_of_birth具有相同列名的表中。
4 个解决方案
#2
2
This will work
这会奏效
SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '27-Jan-2011', 13), 103);
#3
2
Try this:-
SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '23-Oct-2016', 13), 103);
103
is for dd/mm/yyyy
format
103是dd / mm / yyyy格式
Check out this link
看看这个链接
#4
0
Try this:-
INSERT INTO SecondTable(Column1)
INSERT INTO SecondTable(Column1)
SELECT CONVERT(VARCHAR(10),CAST(dt_of_birth AS DATETIME),103) FROM FirstTable
SELECT CONVERT(VARCHAR(10),CAST(dt_of_birth AS DATETIME),103)FROM FirstTable
#1
#2
2
This will work
这会奏效
SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '27-Jan-2011', 13), 103);
#3
2
Try this:-
SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '23-Oct-2016', 13), 103);
103
is for dd/mm/yyyy
format
103是dd / mm / yyyy格式
Check out this link
看看这个链接
#4
0
Try this:-
INSERT INTO SecondTable(Column1)
INSERT INTO SecondTable(Column1)
SELECT CONVERT(VARCHAR(10),CAST(dt_of_birth AS DATETIME),103) FROM FirstTable
SELECT CONVERT(VARCHAR(10),CAST(dt_of_birth AS DATETIME),103)FROM FirstTable