0

date function

Hi,

How can I calculate the first day or the last day of a year?
That is, given a field that contains the year, for example 2019, use a calculation to have a field with January 1, 2019 and another with December 31, 2019.

Thank you
 

6 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Hi,

    In this example, the field for the year is a number field 'Year' and the two other fields are date fields 'Begin' and 'End'.

    You can put this code in the Trigger after update of the 'Year' field or in a button.

    let t := Year;
    Begin := date(t, 1, 1);
    End := date(t, 12, 31)

    Steven.

    • Nick
    • 4 yrs ago
    • Reported - view

    Something like this:

    ---

    let myYear := YourYearField;
    'YourFirstDate' := date(myYear, 1, 1);
    'YourLastDate' := date(myYear, 12, 31)

    ---

    • Nick
    • 4 yrs ago
    • Reported - view

    ooops :-)

    • Antonio
    • 4 yrs ago
    • Reported - view

    Thanks

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Haha Nick, 😇

    • Nick
    • 4 yrs ago
    • Reported - view

    ^$#&*(*$&%&$*....

    Next time Steven! LOL

Content aside

  • 4 yrs agoLast active
  • 6Replies
  • 1060Views