F.Patel F.Patel - 1 year ago 76
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?

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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download