I am facing an issue for finding exact date difference in Months.
My requirement is like
difference in months between two dates in 2015-01-25 00:00:00.000 and 2015-04-25 00:00:00.000 should be 3
difference in months between two dates 2015-01-25 00:00:00.000 and 2015-04-26 00:00:00.000 should be > 3
SELECT DATEDIFF(MONTH, '2015-01-25 00:00:00.000', '2015-04-28 00:00:00.000')
if you use DATEDIFF Function,then both of the above examples will return same value 3. ie SELECT DATEDIFF(MONTH, '2015-01-25 00:00:00.000', '2015-04-26 00:00:00.000') is 3.But i need result which is greater than 3.
How can i implement above requirement using a single select query.
DATEDIFF(MONTH, '2015-01-25 00:00:00.000', '2015-04-26 00:00:00.000')? Do you want it to be3.xx?