Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › day of year
- This topic has 7 replies, 3 voices, and was last updated 2 years, 6 months ago by
Glen Forister.
-
AuthorPosts
-
June 15, 2023 at 2:53 PM #49605
Glen ForisterParticipantI 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 LeuParticipantYou 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 2 years, 6 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksJune 16, 2023 at 10:26 AM #49608
BrendanKeymasterGlen, 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 ForisterParticipantThat 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 LeuParticipantThe return type for
DATE()is text.Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksJune 17, 2023 at 12:00 PM #49613
Glen ForisterParticipantOK, 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
BrendanKeymasterGet 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 2 years, 6 months ago by
Brendan.
June 17, 2023 at 3:05 PM #49617
Glen ForisterParticipantThanks, 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.
-
This reply was modified 2 years, 6 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.