Thank you so much for looking into this, I appreciate it. Our goal is whenever a record is being created during Saturday and Sunday, those records will logged a date on Monday at 7am no matter what time the records was created during weekends. The problem with the formula is if Weekday=“Saturday” or “Sunday”, it’s giving as the created date and time instead. Here’s the formula that we’re trying to fix in one of our database, we want those records that being created on weekends to logged a date on Monday at 7am. This is the formula with the date field instead of the NOW() function. I replaced the NOW() with a date field but still not giving me the result we want. To give you a better insight of what we’re trying to accomplish, here’s the result with the formula you provided. There was no error, it’s just that it’s not the result we’re looking for. I did the formula you provided but the NOW() function is always updating in a time interval, so the result of the formula changes as well. Hi Ben! I appreciate the help especially when you’re not at your computer and still provided insight. The formula field supports 98 different functions and operatorsand there are almost boundless possibilities for how you can use them. If that doesn’t work (I’m not able to test it) or if you have any questions, please let me know and I’d be happy to help! Formula fields use both operators (think your basic mathematical symbols like + or ) and functions (more advanced calculations, such as parsing dates and times, figuring out averages, and rounding). The formula should return this: July 8th, 2022 8:00 AM.ĭepending on how complex your use case is, scripting can be better, but handling date/time values in programming can be frustrating, especially since Airtable doesn’t allow you to import libraries. If we wanted to have the formula go from right now to July 8th, 2022 at 8am, we would use this formula: DATETIME_FORMAT( This time, we’ll change the parameter from being 'days' to 'hours'. So, if we know that the time always defaults to midnight on the date, we can use another DATEADD function to set the time for the desired result. Notice that while it went from 7/7/22 to 7/8/22, but the time defaults to midnight. You would get something like this: J12:00 AM. So if you were to format the result of the function into a DATETIME_FORMAT function like this: DATETIME_FORMAT( The thing to know about the DATEADD function is that it supports adding an array of time/date parameters. See below for a quick example of how DATETIME_FORMAT can transform a date field from one format to another.I’m not at my computer right now, so I can’t build an example and provide screenshots, but I can explain it nonetheless. For a full list of supported format specifiers, please see this article. The format specifier can be something like 'DD-MM-YYYY,' 'YYYY/MM/DD,' 'MM.DD,' etc. The format specifier will allow you to dictate the structure of how your date should be returned. The formula will follow the recipe of: DATETIME_FORMAT(, '') The DATETIME_FORMAT function will allow you to reformat the data from a date-type field into a string following your specifications. For more information on DATETIME_FORMAT, and other formulas, we recommend checking out the formula field support article. If you would like to incorporate a date (and time) type field into a formula field, the best way to format that date is using the DATETIME_FORMAT function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |