difference between two dates mysql in days code example
Example 1: mysql datediff days
#Get date diff in days
select DATEDIFF('2020-04-13', '2020-04-20');#returns -7
select DATEDIFF('2020-04-20', '2020-04-13');#returns 7
Example 2: select amount weeks between two dates mysql
##syntax: FLOOR(DATEDIFF(DATE(column_end_date), DATE(column_ini_date))/7)
Select FLOOR(DATEDIFF(DATE(20090215), DATE(20090101))/7);