Configure function field to get date difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
when I'm creating a report I had to get date difference between current date and table value.
I used configure function field to do that, can anyone help me to do the calculation to get the value.
u_access_last_verified is the table column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @pathumharsh
You need to use 2 date
| datediff() | Takes two date/time fields as input, calculates the difference between the dates in days, minutes, and seconds, and returns the results as a duration field value. | glidefunction:datediff(closed_at, sys_created_on)
Returns the duration of an incident from the creation date to the close date. Example result: 10 days, 8 hours 23 minutes 11 seconds Return type: Duration |
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
this is feasible but there is a challenge when you use now() there
I shared a workaround for this and it has a working solution
Function field to calculate Ageing in Report Designer
sharing here again
blog below
Function Fields in ServiceNow Reports: Calculate and Display Data on the Fly
As per the link I shared it says invalid syntax, but there is a workaround for that
It worked fine for me see below when I used that workaround
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @Ankur Bawiskar ,
Can I get your help? I have a similar requirement for using a function in reports.
I have a string field where agent enters a number like 1, 5, 8, 50, 120..... anything
Now, I want to show Row Column report, where Row would be the state and column would be like
First Column(1-10) [Records having value from 1 to 10), Second Column(11-20) [Records having value from 11 to 20] and so on....
I have tried dividing the value by 10, and multiplying again. But, somehow it's not working.
Regards,
Najmuddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
will have to check in PDI
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
