Calculating Ages etc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MicKress
    Senior Member
    • Aug 2017
    • 105

    Calculating Ages etc

    Hi, can please anybody help me with the formula to calculate ages for example? Its the datediff expression, but you have not only to take care of not years, but also months and days. How can I combine this? Thanks a lot, regards Michael
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hi,
    just using formula without a workflow isn't a good idea, because formula can update values only, when you save a record.
    With Workflow feature it's possible to make the system to send notifications about birthdays of contacts or other entities like users, leads. You need to have a date field that represents date of birth in your entity (e.g. entity Contact, field dateOfBirth). You can create it in Entity Manager.



    fullYears=datetime\diff(datetime\today(), birthday, 'years');
    this formula works ok

    Birthday
    22 May, 2016
    FullYears
    1

    Birthday
    05 May, 2016
    FullYears
    2

    Comment

    • MicKress
      Senior Member
      • Aug 2017
      • 105

      #3
      Thank you, you‘re right. I didn‘t consider that age is only actual at the point when a contact is saved when using a formula. So I‘ll try to solve the problem with workflow. Regards Michael

      Comment

      Working...