Skip to content
Advertisement

SQL Server: Convert YYYYMMDD-HHMM and YYYYMMDD to mm/dd/yyyy hh:mm

I am trying to convert the time format from YYYYMMDD-HHMM and YYYYMMDD to mm/dd/yyyy hh:mm. My issue is that the data is not consistent. Below is some exemple:

I tried to use:

but the issue is that some data does not have time.

Advertisement

Answer

You can do it like this:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement