MySQL Forums
Forum List  »  Newbie

Calculate Months & Years from Integer
Posted by: Bevan Robinson
Date: March 24, 2020 08:46PM

I have two columns. MonthA and MonthB. I want to calaculate the difference between them and then return that as a string.

MonthA will always be higher than MonthB.

Example

MonthA: 74
MonthB: 14
Result: 6 Years 2 Months.

I can calculate the difference in dates to get years but is there a way I can do this within my SQL command.

Options: ReplyQuote


Subject
Written By
Posted
Calculate Months & Years from Integer
March 24, 2020 08:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.