0

age rand field

Hi everyone,

 

In a database, i want to create fields that would show me age range with which i could create statistics.

There would be three data points: date of birth, and both date of debut and end of contract

From these three data points, can i make fields/formulas, like:

—year range when the person worked for the company (e.g. 2005–2010)

—age range of the person when he worked for the company (e.g. from 35 to 40 years old)

I tried a few things but so far i wasn’t able to do what i wanted. Is it possible? Any ideas?

 

Best regards to everyone, and thank you for your time and help,

Charlie

4 replies

null
    • Mconneen
    • 5 yrs ago
    • Reported - view

    This will get you close .. :)   Remember .. Date fields are stored as milliseconds from .. (I think Jan 1 1970..but I do not recall exactly).. 

    let days := split(text('Hire Date' - 'Birth Date'), " ");
    number(item(days, 0)) / 365

    • Charlie_Cortial
    • 5 yrs ago
    • Reported - view

    Thank you for your answer Mconneen !

    It helped me understand more how this could work.

    Thank you :-)

    • Mconneen
    • 5 yrs ago
    • Reported - view

    You bet Charlie..   The date subtraction gave us the "number of days".. so I ignored leap year. and simply snagged the number of days and divided by 365..   

    You can go by the "number of milliseconds" which is the base value..  You will have to look up the base date. I think it is Jan 1 1970.. but don't hold me to that.   Basically it gives you the number of milliseconds between the "base"  and the "duration" between Birth Date and Hire Date.

    Happy NinoxING.  :) 

    • Charlie_Cortial
    • 5 yrs ago
    • Reported - view

    Hi again Mconneen,

    It's mostly blocks in my head, getting it around to understand how I could make it work, thank you a lot for that !

    Nice... NinoxING, I like it !

    Best regards,

    Charlie

Content aside

  • 5 yrs agoLast active
  • 4Replies
  • 1824Views