I want to create a formula to have years of service (i.e. 5, 10, 15, 20 years etc...) for employees. Below is a formula that was used. I am not an expert with crystal reports. However, I want to create a formula and to also set a parameter so that the parameter prompt will be set in a way that the report will only pull employees with say 5, 10, 15, etc years of service.
Service Year Formula used:
//When running this report, you must input a Service Recognition Year parameter. For example, if the
//current date is November 17, 2005 and you want to recognize employees with five years of completed
//service at a luncheon in Feb. 2006 , then you would input a Year parameter of 2000 (ie. 2000 = Year 0, 2001 = Year 1,
//2002 = Year 2, 2003 = Year 3, 2004 = Year 4, 2005 = Year 5). The rationale is that employees must complete at least
//five full years of service or more. For example, if someone is hired on Dec. 12, 2000, then they haven't worked a full year
//until Dec. 12, 2001.
//Dec. 12, 2000 - Dec. 12, 2001 - one year
//Dec. 12, 2001 - Dec. 12, 2002 - two years
//Dec. 12, 2002 - Dec. 12, 2003 - three years
//Dec. 12, 2003 - Dec. 12, 2004 - four years
//Dec. 12, 2004 - Dec. 12, 2005 - five years
//Record Selection criteria says only show people either if the year of their Hire Date is equal to the
//year of Year parameter (ie. Year parameter = 2000 Hire date = October 18, 2000) or if the year of their
//rehire date is equal to the year of the Year parameter (ie. Year parameter = 2000 Hire date = July 2,
//1980 Rehire Date = April 28, 2000).
//Calculates the Service Recognition year. For example, if you run the report on November 17, 2005, then
//the current year (@Current Year) is 2005. And, when you run the report and choose the Parameter year
//to be 2000, then the Service Recognition Year is 2005 - 2000 = 5 Year Service Award.
//{@Current Year} - {@Parameter Year to Number}
2008 - {@Parameter Year to Number}
Year Parameter Setting Used:
Please enter the Recognition year (YYYY). This year will be counted as Year 0 (ie. If running the report in Nov. 2005 to celebrate 5 Years of Recognition in Feb. 2006, then enter 2000; where 2000 = Year 0, 2001 = Year 1, 2002 = Year 2, 2003 = Year 3, 2004 = Year 4, 2005 = Year 5).
Any help will be very much appreciated as I'm not an expert with crystal reports. Thanks!