Function field using datediff, task.due_date, and the current date

David Hepburn
Tera Guru

I need to create a report based off of the [task] table that shows the # of days between the current date and task.due_date. 

 

I've seen a lot of discussions around calculating durations that involve the current date.  None of them seem to address this particular scenario -- scenario being the use of the current date in a date calculation.

 

What would you enter in the Script box (shown in the screenshot) to make this happen?

 

datediff.png

 

If a function field is the wrong way to get there, I'm open to suggestions 😀 thanks!

David Hepburn, III (he / him) | Paramedic
CSA, Senior Enterprise Application Analyst
ServiceNow DevOps
Children’s Health System of Texas
Dallas, Texas, USA
1 ACCEPTED SOLUTION

David Hepburn
Tera Guru

Found a solution!

 

Add a dictionary entry like this:

DavidHepburn_0-1732899482402.png

 

This function is calculating the # of days between today and sys_updated_on; it is displaying that calculation in a column named "Time Since Updated" in table "u_age_tasks."

 

 

David Hepburn, III (he / him) | Paramedic
CSA, Senior Enterprise Application Analyst
ServiceNow DevOps
Children’s Health System of Texas
Dallas, Texas, USA

View solution in original post

2 REPLIES 2

David Hepburn
Tera Guru

Found a solution!

 

Add a dictionary entry like this:

DavidHepburn_0-1732899482402.png

 

This function is calculating the # of days between today and sys_updated_on; it is displaying that calculation in a column named "Time Since Updated" in table "u_age_tasks."

 

 

David Hepburn, III (he / him) | Paramedic
CSA, Senior Enterprise Application Analyst
ServiceNow DevOps
Children’s Health System of Texas
Dallas, Texas, USA