ISDATE() equivalent for MySQL

后端 未结 5 1362
迷失自我
迷失自我 2021-01-12 01:45

I have a line of code for SQL server which takes a date listed as \"YYYYMMDD\" where the DD is 00 and converts the 00 to 01 so that it works with datetime. I would like to

5条回答
  •  清酒与你
    2021-01-12 02:24

    You can try using the STR_TO_DATE function. It returns null if the expression is not date, time, or datetime.

    WHERE STR_TO_DATE(dt, '%d,%m,%Y') IS NOT NULL
    

提交回复
热议问题