Convert Data SQLServer

1

I would like to convert 02/01/2018 to 2018-01-02 00:00:00.000 , what I found on the internet so far was:

select CONVERT (datetime, '02/01/2018', 120) 

That returns me 2018-02-01 00:00:00.000 , a little different than I need.

What number should I use instead of 120 ?

    
asked by anonymous 02.01.2018 / 18:35

1 answer

3

According to this answer from the OS, the code you want is 103 :

select CONVERT (datetime, '02/01/2018', 103)
    
02.01.2018 / 19:00