- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2022 04:21 PM
How do i create a date calculated field in a table.
I want to create a calculated field with my current date field and add 20 days to it to create a new field
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2022 05:40 PM
Hello,
Are you wanting this field to update every day, to today it's today+20 and then tomorrow is it, tomorrow+20?
So each day it just shows that current date and adds 20?
If so, a calculated field won't work for you. Calculated fields are meant for static information and is only updated/evaluated to be updated, whenever the record is updated. So it won't check itself every day.
If you're only wanting to be current date + 20, once, when the record is created, for example...then you could just use script in the default value for the field to do that, without a calculation.
Such as:
javascript:var gdt = new GlideDateTime(); gdt.addDays(20); gdt;
If it's a Date/Time field, if it's just date then you can use:
javascript:var gd = new GlideDate(); gd.addDays(20); gd;
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2022 05:40 PM
Hello,
Are you wanting this field to update every day, to today it's today+20 and then tomorrow is it, tomorrow+20?
So each day it just shows that current date and adds 20?
If so, a calculated field won't work for you. Calculated fields are meant for static information and is only updated/evaluated to be updated, whenever the record is updated. So it won't check itself every day.
If you're only wanting to be current date + 20, once, when the record is created, for example...then you could just use script in the default value for the field to do that, without a calculation.
Such as:
javascript:var gdt = new GlideDateTime(); gdt.addDays(20); gdt;
If it's a Date/Time field, if it's just date then you can use:
javascript:var gd = new GlideDate(); gd.addDays(20); gd;
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:45 AM
Hi,
No, I am looking for date/time column which is already populated with data from last couple of years. I want to add 20 days to that specific column. and i appreciate for you response.