Datediff between 2 columns in same table
34,707
Solution 1
select DATEDIFF (day,start_date,end_date) from yourtablename;
Solution 2
Should be Datediff(day, start_date, end_date)
. There is no 's' at the end of the day
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on August 14, 2020Comments
-
Admin almost 4 years
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?