I have a number of reports utilizing the following formula to populate "Next Review Date" from a system that sets "review Date" as one year from hire date - this stinks so I had to create this:
datevar review:={HR_NEW_DIVISION.REVIEW_DT} ;
datevar revadj;
datevar cdadj;
datevar out;
revadj:=date(year(today),month(review),1);
cdadj:=date(year(currentdate),month(currentdate),1);
if review > currentdate then out:=review else
If revadj < cdadj then
out:=date(year(currentdate)+1,month(review),day(review)) else
out:=date(year(currentdate),month(review),day(review));
out
To fix it - it pushes the date into the proper year - If my review was in April - next review is 4-2005 - if it is in July then 7-2004 will stay.
My new problem is that some records are starting to show up without review dates - how can I change this to first look at review date - and if it is blank use hire date?
datevar review:={HR_NEW_DIVISION.REVIEW_DT} ;
datevar revadj;
datevar cdadj;
datevar out;
revadj:=date(year(today),month(review),1);
cdadj:=date(year(currentdate),month(currentdate),1);
if review > currentdate then out:=review else
If revadj < cdadj then
out:=date(year(currentdate)+1,month(review),day(review)) else
out:=date(year(currentdate),month(review),day(review));
out
To fix it - it pushes the date into the proper year - If my review was in April - next review is 4-2005 - if it is in July then 7-2004 will stay.
My new problem is that some records are starting to show up without review dates - how can I change this to first look at review date - and if it is blank use hire date?