I’m sure it’s simple, but I can’t seem to get it right. How do you calculate a field to add “x” days from another date field? In other words, new date = date + 14 days (for example).
Thanks!
Awesome… didn’t know about DATEADD. Now, how do I format it into YY-MM-DD. It’s returning the long date including time (May 25, 2023 at 12:00:00 AM).
I tried DATE(DATEADD([COMPLETED];0;0;0;14;0;0;0);”YY-MM-DD” but that didn’t work. Returned “December 31, 1969 at 12:00:00 AM”.
DATE()
is the correct function to use with a text
return type. Or it might be that you are missing a closing bracket in your formula DATE(DATEADD([COMPLETED];0;0;0;14;0;0;0);”YY-MM-DD”)
.
Tried it again (checked my brackets). Unfortunately, that returns: Dec 31, 1969 at 7:00:23 PM
Back to square one.
Did you set the the return type to text
?
-
This reply was modified 1 year, 5 months ago by Daniel Leu.
-
This reply was modified 1 year, 5 months ago by Daniel Leu.
Attachments:
You must be
logged in to view attached files.
I tried it both ways. no go.
Strange…. Let’s see if @brendan has an idea. BTW, it should be lower case “dd”, upper case “DD” is day of year. And lower case “yy” as well. Here is the link to the explanation of the format http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
Maybe go back to your original implementation and set the date format in the field options.
-
This reply was modified 1 year, 5 months ago by Daniel Leu.
Attachments:
You must be
logged in to view attached files.
Thanks for the info on date formats… I was wondering how that worked.
THAT DID IT! I knew it would be something simple. Thanks Daniel. Much appreciated!
Great that this did the trick. It sill puzzles me why DATE()
didn’t work for you.
My thoughts are if the Date Format setting worked, then the code was returning a Date value and not Text.