Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Use difference between 2 dates in calculation

user7304950Feb 10 2011 — edited Mar 2 2011
Hello,

I want to create a calculation that compares between each month in the year of the forecast and 'Hire Date', so if our year starts in jan-2011. I want to get the difference between jan-2011 and hire date, next month it should get difference between feb-2011 and hire date and so on. The calculation below is trying to check if the difference is more than or equal 1 year.

I have an account named 'Hire Date' of Date type.

I'm trying to write a calculation as follows:

@DateDiff("Hire date",*Current_Date*",DP_Year) >=1)

I need the "Current Date" to contain the full formated date as hire date. I was thinking of producing the current date for example: 01-Jan-2010 to be used in the calculation as follows:

IF(@DateDiff("Hire date",(@CONCATENATE("01",@CONCATENATE(@CURRMBR("PERIOD"),(@CONCATENATE("-",@CURRMBR("YEAR"))))),DP_Year) >=1)
a=b*c;
end if;

Am I on the right track or there's any straight function function or method that can return the current month-year being proccessed in the calculation and use it directly in datediff calculation? or there's any method other than datediff to perform the same ?

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2011
Added on Feb 10 2011
10 comments
5,852 views