select datediff(date1,date2) from tc_ht_money t; select TO_DAYS(date1)-TO_DAYS(date2) as aaasd from tc_ht_money t;