Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datediff between 2 columns in same table

I've got 2 date columns in my table (start_date, end_date).

I've tried Datediff(day, start_date, end_date), but I was prompt with:

invalid column name


How can I calculate the date difference between these 2 columns?

like image 371
Willian Chia Avatar asked Sep 16 '25 17:09

Willian Chia


1 Answers

select DATEDIFF (day,start_date,end_date) from yourtablename;

like image 180
Deepshikha Avatar answered Sep 19 '25 07:09

Deepshikha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!