select DATEDIFF (day,start_date,end_date) from yourtablename;
Datediff between 2 columns in same table
-
29-06-2022 - |
Question
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?
Solution
OTHER TIPS
Should be Datediff(day, start_date, end_date)
. There is no 's' at the end of the day
It should be "day"
Datediff(day, start_date, end_date)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow