Does any one knows why the formula is given the correct result but on the column appears 2 days less?
Dear @Alexis_Vivet , and welcome to the community
Tricky to be sure, based on what I see from a screenshot.
I assume when you make the column type of “Day” to numerical type, you will get “22”
Otherwise, just share a copy of the doc and either me or somebody else will check and find the reason.
@Alexis_Vivet : After testing this a little bit, I think it’s the Time
part in the Start Time
that might not be helping here and is not converted correctly (see the field Erroneous Day()
in my sample below and how the dates show up ).
Now, depending on what your trying to do, you actually don’t need the formula :
Day(thisRow.[Start Time])
Both of your fields seems to be some types of Date
fields, so you can just change the format of your field [Day]
in Date Format
and add a formula to get the date from Start Time
:
thisRow.[Start Time]
The Date/Time
format from your field [Start Time]
will be displayed as you wish in your [Day]
field
Or, you can also extract the date from you Start Time
field using a ToDate()
formula (Still depending on your needs and how you choose to format your fields
)
I hope this help
Make your Day
column a Number type.
Why this is happening:
Dates are actually Numbers in Coda, e.g. today is 44220. This is the number of days since 12/30/1899 12:00 AM in the local timezone (for some reason it’s not 1/1/1900 but this):
Time is fractions of days, e.g. today 12 PM would be 44220.5, and today 6 PM would be 44220.75.
What you see is Day(Start time), which is 22, converted to the “22 days since 12/30/1899”, which is Jan 20. So yeah, just change the column format to Number there, because 22 is a number, not a date.
(for me it says Jan 21, but that’s perhaps because of some timezone adjustments, not sure completely yet what exactly happens there)
If you just need to strip time information (so that values with the same day but different time get into the same group) use StartTime.ToDate()
or StartTime.DateTimeTruncate("day")
Thanks @Paul_Danyliuk for all those precise information !
Thanks to @Paul_Danyliuk and @Pch for your help.