Forum Stats

  • 3,874,496 Users
  • 2,266,746 Discussions
  • 7,911,867 Comments

Discussions

Calculating length of service by increment

Hi There,

I'm trying to calculate incremental anniversary dates using the formula below, but instead of showing 10 as the result, I really want the calculation to bring back the anniversary date i.e 10 + 25/12/2012 should bring back 25/12/2022.

CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Employee Attributes"."Employee NHS Entry Date", CURRENT_DATE)/365.12 <10 AND (TIMESTAMPDIFF(SQL_TSI_DAY, "Employee Attributes"."Employee NHS Entry Date", CURRENT_DATE)/365.12)+2 >=10 THEN '10' 

Can some one please help me with this

Answers