#BPTechTips - Date Intervals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-09-22 04:44 PM
To make this stuff easier to read - and easier to write as well - I create a one-row collection called Date Intervals, and make it globally visible
Initialise all the fields to the secret magic numbers from the Blue Prism help file:
Now I can refer to [Date Intervals.Minute] instead of "6", and it's easy to understand what the calculation's doing:
Just copy the one-row collection to any object or process to enjoy never having to work out those pesky Date Intervals again 🙂
Hope you find this helpful.
------------------------------
Andrew Pascal
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-09-22 08:49 PM
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-02-24 03:16 AM
Love this, great suggestion and well illustrated!
------------------------------
Jeremy Dean
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-02-24 01:58 PM
Why don't you use simply :
ToMinutes([DateTime 2] - [DateTime 1])
------------------------------
Johan Michiels
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-02-24 07:34 PM
I think the point was that many people don't remember the numeric representatives of the time periods (Day is 9, Month is 5 etc.) and they're not very easy to find, especially when you're trying to work out something quickly. The numbers are also an easy way to hide bugs in your code, as I found yesterday when I realised I'd used a 4 rather than a 5 in a DateDiff calculation...
------------------------------
Jeremy Dean
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
28-02-24 01:40 PM
I agree Jeremy I just wanted to offer an easier way to do it knowing that Bleuprism warns that DateDiff is deprecated !
Time to get rid of it 😉
------------------------------
Johan Michiels
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
28-02-24 06:38 PM
Interesting! I needed to identify transactions where the different between start and end dates was no more than 3 months so I did this:
(DateDiff([Date Intervals.Month], [RFC Start Date], [RFC End Date]))<=3
I could have used ToDays and 90 as you suggest.
------------------------------
Jeremy Dean
------------------------------
