Mar 04, 2020 07:55 PM
OK, all you smart people out there. (I know there are a lot of you!) I need a formula for my database and I need some help, (because I’m horrible with math and algebra.)
I have different churches with different services and studies through the week. The services are stored in the database with an unspecified date/day/time. (e.g. Bible study is every Tuesday night at 7:00pm) On an Airtable calendar I want to display an actual date to the user. (i.e. Tuesday, March 10th.) In order to do this I have to calculate what the next actual future date will be from whatever is the current date. It has to dynamically adjust with any given day the user might be looking at the calendar.
So…
Mar 04, 2020 08:26 PM
Hi @Doug_Gregan,
Do you have access to Blocks in your base? IE, do you pay for the Pro plan?
If so, the Scripting Block might make this task a lot easier.
Either way, it would be helpful to know quite how you have your base set up. For starters, I might suggest a setup similar to this:
Mar 04, 2020 08:50 PM
Hello Jeremy,
Yes, that’s essentially my setup, with the exception of the frequency, which I love and will add.
It would be quite accurate to say that I don’t write javascript. I’ve modified some code, but not much else.
Mar 04, 2020 08:57 PM
Fair enough – but if you have access to the Scripting Block, somebody else could write JavaScript for you that would make this alot easier. Doing what you are asking in a formula is more complicated than doing it in JavaScript, for someone who knows JavaScript.
Mar 04, 2020 09:06 PM
Not sure why my previous post is pending, but I’ve got something similar to this that I can share with you if you wish to reverse-engineer it and adapt it to your situation. I don’t have time to delve into the inner workings right now, although I do plan to share a how-to in some form (video, probably) at some unknown point in the future.
Mar 04, 2020 09:07 PM
Here’s a screenshot from my setup. It’s flexible enough that I can specify lots of different intervals, and they all calculate correctly. This is all formula-driven.
Mar 04, 2020 09:14 PM
I would be interested in attempting to modify whatever you can share, Justin. Thank you!
Mar 04, 2020 09:27 PM
Here’s a version that anyone can mess with: