day of year

Viewing 7 reply threads
  • Author
    Posts
  • June 15, 2023 at 2:53 PM #49605

    Glen Forister
    Participant

    I have a Form that had the date I visited a field (over many years).

    I want another field to tell me the number of the “day of the year”

    I tried this where I gave a starting date (no year), and the field that holds the date of the visit.

    DAYS(January 1;Visit Date)

    Of course this doesn’t work.  How do I do this?

    June 16, 2023 at 8:16 AM #49606

    Daniel Leu
    Participant

    You can use a calculation field with following formula: DATE([Visit Date]; "D")

    DATE() has many formatting options, luckily, day-of-the year is one of them. Here is the documentation http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns

    • This reply was modified 1 year, 6 months ago by Daniel Leu.
    June 16, 2023 at 10:26 AM #49608

    Brendan
    Keymaster

    Glen, the DAYS() function will just give you the number of days between two dates. Daniel’s reply is what you want to use to get the day of the year.

    June 16, 2023 at 5:23 PM #49611

    Glen Forister
    Participant

    That sounds good, but I don’t get any errors and no number shows up in the field.

    The calculated is “Result Type” = number.

    The filed is formated “decimal”, no decimals, – changed it to this after it was defalut “no style”.

    What am I missing?

    June 16, 2023 at 8:40 PM #49612

    Daniel Leu
    Participant

    The return type for DATE() is text.

    June 17, 2023 at 12:00 PM #49613

    Glen Forister
    Participant

    OK, I’ve set the format to Text.

    Am I missing something else.  See attached.

    Attachments:
    You must be logged in to view attached files.
    June 17, 2023 at 2:31 PM #49615

    Brendan
    Keymaster

    Get rid of the square brackets [  ]. That’s just for putting fields into the iOS version. The Mac version puts the fields as token buttons into the formula editor.

    • This reply was modified 1 year, 6 months ago by Brendan.
    June 17, 2023 at 3:05 PM #49617

    Glen Forister
    Participant

    Thanks, that did it.  I looked up the documentation for Day, and the associated links, but couldn’t understand the formatting using the ” ” etc.  Very confusing.

Viewing 7 reply threads

You must be logged in to reply to this topic.