I want to transfer one Date Column with format '/' to '-', for example, one date data like '10/19/2018 2:49:47 PM', but I want the format '2018-10-19 14:49:47'. I have tried below actions, like using convert, but it seems does not work.
SELECT [LMDM_Data] ,convert(varchar(100),LMDM_Data,23) ,CAST(LMDM_Data as varchar(10)) FROM Table
Below is the result:
LMDM_Data (No column name) (No column name)
10/19/2018 2:49:47 PM 10/19/2018 2:49:47 PM 10/19/2018
To verify whether this column is Date, I use isDate() function to check, and they all return 1.
SELECT [LMDM_Data] ,ISDATE(LMDM_Data), convert(varchar(100),LMDM_Data,120) ,CAST(LMDM_Data as varchar(10)) FROM [ESS_NJ_LMDM_PDM].[dbo].[maintanence_workload]
Below is the result:
LMDM_Data (No column name) (No column name) (No column name)
10/19/2018 2:49:47 PM 1 10/19/2018 2:49:47 PM 10/19/2018