morinia
asked on
Converting a date time date to ddmmyyyyformat
I am reading a table using PROC SQL from a SQL Server database. The DOB field is coming in datetime format.
I would like to convert 02FEB1951:00:00:00.000 to 02FEB1951
I would like to convert 02FEB1951:00:00:00.000 to 02FEB1951
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use the following in your code
SELECT REPLACE(CONVERT(VARCHAR(11 ), <fieldName>,106), ' ', '') AS [DDMonYYYY]
SELECT REPLACE(CONVERT(VARCHAR(11
set @date = '02FEB1951'
select @date as [Original Date]
, convert(varchar(10), @date, 106) as [dd mon yy]
, replace(convert(varchar(10