select TO_DAYS(str_to_date('12/1/2001 12:00:00 AM','%m/%d/%Y')) -TO_DAYS(str_to_date('11/28/2001 12:00:00 AM','%m/%d/%Y')) as a from table1