Home > Blockchain >  How to convert 21/09/2009 to 2007-09-21 00:00:00.000 format in sql?
How to convert 21/09/2009 to 2007-09-21 00:00:00.000 format in sql?

Time:12-22

How to make this type of SQL Conversion

I tried this SELECT CONVERT(datetime, 21/09/2007, 131)

CodePudding user response:

I think you are trying to convert 21/09/2007 to 2007-09-21 00:00:00.000:

SELECT TIMESTAMP('2007/09/21');

CodePudding user response:

It seems that 131 is the wrong code. I run the above and works fine:

SELECT CONVERT(datetime, '21/09/2007', 103)

You can see more details here

  • Related