Use difference between 2 dates in calculation
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.