SOLVED
How to Add Years to a Date Field
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
johnnykoung
8 - Asteroid
‎09-03-2019
05:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I was wondering how I would add 10 years to a date field I have. For example Start Date is 9/5/2019 add ten years and End Date is 9/4/2029
Thanks,
Johnny
Solved! Go to Solution.
Labels:
- Labels:
- Tips and Tricks
1 REPLY 1
lmorrell
11 - Bolide
‎09-03-2019
05:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @johnnykoung
Solution is attached.
There are two ways you could get this done - both solutions have the formulas in the attached workflow.
You can convert your date to a datetime field and then use the function
DateTimeAdd([Date], 10, 'years')
to add 10 years AND have your date formatted as a datetime field.
If you only need the year to update and will do your processing at a different point in the workflow you can use the formula
left([Date], Length([Date])-4) + tostring(tonumber(right([Date],4))+10)
to add 10 years to your year field.
Hope this helps!
