in Education by

I am trying to format of years and months in a manner like yy-mm I can calculate like this to get my year value: ROUND(months_between(sysdate,hiringdate)/12) And this to get the months value: ROUND(months_between(sysdate,hiringdate)) I just dont know how to combine those 2 to get them in the yy-mm format JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

Please log in or register to answer this question.

1 Answer

0 votes
by

This looks like Oracle, so try this: select (lpad(floor(months_between(sysdate, hiringdate)/12), 2, '0') || '-' || lpad(mod(floor(months_between(sysdate, hiringdate)), 12), 2, '0') ) as yymm

Related questions

0 votes
0 votes
0 votes
0 votes
...