Today and 14 days ahead

Yes, all the time.
But, I missed a column in that solution that I gave you - oops :man_facepalming:

THIS is how I would do it:

  • Math column to return todays date
  • Math column to add the row index to todays date
  • Math column to convert to YYYYMMDD

This approach deals with month/year boundaries just fine.

Sorry about that, I’m not sure what I was thinking yesterday :crazy_face:

1 Like

It should be, but you could potentially come unstuck by device regional date formatting issues, especially if you have Dates saved as text anywhere.

Personally, I think the “convert-to-integer” approach is a more robust approach. I’ve never known that to fail.

(as long as it’s done properly, of course) :wink:

1 Like

I understand the formula very well. From your explanation, it’s seems TRUNC acts differently when applied to a difference between dates than applied to a date only. Intuitively, since Date is the integer and Time the float (at least this is my understanding), then I would have expected TRUNC(DateTime) to be Date (at midnight).

I will hit the sack, ponder this, and experiment tomorrow morning. Thank you Jeff for your explanations.

Darren, we cross paths, good morning! :sun_with_face:

2 Likes

Yes, that is definitely true, and Trunc(Now) is essentially the date at midnight, but the result for today is 44966 which can be converted back to a normal date in Google, but there is no function in Glide to convert it back to a date. 44966 is the number of days since Dec 30th 1899. That’s not a number that’s useful for me to subtract a few hours.

I guess an easier alternative would be to set the seed date to Dec 30th 1899 at midnight and then change the math column to seed+TRUNC(now). Probably should have thought of that instead. That makes a lot more sense.

I wish Glide had functions in the math column to convert text to date, similar to Google’s DATE and DATEVALUE functions. Then we wouldn’t need some of these extra columns to make these functions work.

(Sorry guys, I’m living in the past. Feb 9th really is today for me. :wink: )

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.