Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Difference b/w two dates in months

hello Guys,

I need to calculate difference between two dates and the results should be in months .

For ex:-

end date 01/01/2016

start date 01/01/2013

Results should be in months

Kindly help me with script .

Thanks,

ravi

1 Solution

Accepted Solutions
sunny_talwar

Try this

SET MonthDiff = ((2016*12)+1) - ((2013*12)+1);

View solution in original post

4 Replies
sunny_talwar

Anonymous
Not applicable
Author

thanks sunny for the link

I referred his link and i am trying but I am not getting result

SET MonthDiff=((year(2016)*12)+month(01)) - (((year(2013)*12)+month(01)));

Can u c whats wrong here plz.

Thanks,

ravi

sunny_talwar

Try this

SET MonthDiff = ((2016*12)+1) - ((2013*12)+1);

Anonymous
Not applicable
Author

Thanks a lot sunny it worked !