How to compare a longtext and date value in sql?

后端 未结 1 541
-上瘾入骨i
-上瘾入骨i 2021-01-25 05:59

I have date value stored in format dd.mm.yyyy as longtext. I need to compare this value to CURDATE() within a SELECT statement. (Pleas

1条回答
  •  生来不讨喜
    2021-01-25 06:40

    As Sergey comments: if MySQL, you can simply use STR_TO_DATE:

        ...
    WHERE STR_TO_DATE(longtext_date_value,'%d.%m.%Y') <= CURDATE()
        ...
    

    0 讨论(0)
提交回复
热议问题