September 15, 2014 at 1:57 pm
Think I have Date as SysDate Minus 20101101.
I should Trunc SysDate & Given date to YYYYMM Now I shoud do minus given date.
EX:- 201409-201011
It should only calculate Months not Days.
I tried Month_Between but is giving wrong answer.
Please help.
September 15, 2014 at 2:33 pm
Why is it giving a wrong answer? In other words, what would be the correct answer and what are you getting right now?
September 15, 2014 at 2:39 pm
this is an example. I have a similar situation. When i use the Month Difference it also taking the Dates in to considerations os the results are comming as decimals.
This willnot kill server. it just the claims calculation.
September 15, 2014 at 2:46 pm
The following code returns a value of 10. Is that what you're after?
SELECT months_between(TRUNC(TO_DATE( '20131101', 'YYYYMMDD'), 'MM'), TRUNC(SYSDATE, 'MM'))
FROM Dual;
September 16, 2014 at 6:50 am
Thanks Luis. now only Months are calculatiing.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply