Parse Date from MM/DD/YYYY to a format MYSQL can work with

前端 未结 3 1845
悲哀的现实
悲哀的现实 2021-01-28 13:55

Currently working with a MLS data dump in which all their dates are formatted in MM/DD/YYYY , Trying to get the min/max age

        MIN( DateDiff( NOW(), idx_com         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-28 14:14

    Use str_to_date to convert idx_common.list_date.

    MIN( DateDiff( NOW(), str_to_date(idx_common.list_date,'%m/%d/%Y') ))) AS listage_min,
    MAX( DateDiff( NOW(), str_to_date(idx_common.list_date,'%m/%d/%Y') ))) AS listage_max
    

提交回复
热议问题