F.Patel F.Patel - 6 months ago 45
SQL Question

Getting difference betwen 2 dates

I have 2 dates which is start date and end date
let's say start date is 07/01/2015 and end date is 12/31/2017 so, difference is 2 years and 6 month but i need output as 2.5 years

How can I get output as 2.5 years?

Select DateDiff(DD,'07/01/2015','12/31/2017')/365.0