BOFocus – Crystal Reports Tips – Tricks – Tutorials

Crystal Reports - Formulas

Listing employees length of service in months

The end result to the following formula will show the the length of service in months for an employee.

1. Create the following formulas and place in the detail section:

2. Create the first formula and name it Months:

DateDiff(“m”, {emp_basic_all.adj_service_date}, Currentdate)

3. Create the second formula and name it LOS:

Truncate(({@Months}/12), 0)

Place both formulas in the detail section to review the output.

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



A formula that is placed on a report is indicated by the @ prefix (for instance, @Name).