- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-10-23 01:18 PM
I need to write two dates into a text field in the format dd.MM.yyyy. The start date should be the nearest previous 15th, and the end date should be today's date. Any tips on how to do this in Blue Prism? Your advice would be a big help! Thanks!
------------------------------
Sandy P
RPA Developer
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 08:44 AM
Hi @Sandy P - What if today's date is 01-November - do you still want 15th of October ?
ToNumber(Left(Today(),2))>15 - Where you can decide to check the previous nearest 15th. i.e. this gives you False decision -
If False - Calculation Stage -
If True :
------------------------------
Regards,
Mukesh Kumar - Senior Automation Developer
NHS, England, United Kingdom, GB
------------------------------
Mukesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-10-23 02:01 PM
Hi Sandy,
You can try something like below.
Start Date:
Today :
------------------------------
Athiban Mahamathi - https://www.linkedin.com/in/athiban-mahamathi-544a008b/
Technical Consultant,
SimplifyNext,
Singapore
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-10-23 02:51 PM
if today's date is, for instance, 31st October, I want the start date to be the nearest previous 15th, which means it should be 15th October. How can I handle this situation ?
------------------------------
Sandy P
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-10-23 03:16 PM
Hi Sandy,
You can use a decision stage to find if the today's date is crossed current month 15th. If yes, then you can get the current month 15th date else you can get the previous month 15th date.
------------------------------
Athiban Mahamathi - https://www.linkedin.com/in/athiban-mahamathi-544a008b/
Technical Consultant,
SimplifyNext,
Singapore
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-10-23 03:25 PM
Hi Atibhan ,
What to provide in decision stage ?
------------------------------
Sandy P
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 05:38 AM
I tried , but it did not worked !
How can we compare date ?
------------------------------
Sandy P
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 08:44 AM
Hi @Sandy P - What if today's date is 01-November - do you still want 15th of October ?
ToNumber(Left(Today(),2))>15 - Where you can decide to check the previous nearest 15th. i.e. this gives you False decision -
If False - Calculation Stage -
If True :
------------------------------
Regards,
Mukesh Kumar - Senior Automation Developer
NHS, England, United Kingdom, GB
------------------------------
Mukesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 10:30 AM
Hey Mukesh
It worked ! Thanks a lot !!!
------------------------------
Sandy P
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 11:04 AM
Great work team 👏 Congrats @Mukesh Kumar on the best answer!
------------------------------
💙 Michael
(I'm part of the SS&C Blue Prism Community Team)
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-23 01:21 PM
Sorry, I just have to point out that the answer @Mukesh Kumar gave will be incorrect at least 12 times during the year. For example; the date "11/11/2023" will give you "15/15/2023" with the Replace function, which will cause an error in the ToDate function.
For any regional date formats, you can use the following for days under 16:
AddMonths(MakeDate(15, FormatDate(Today(), "MM"), FormatDate(Today(), "yyyy")),-1)
Else
MakeDate(15, FormatDate(Today(), "MM"), FormatDate(Today(), "yyyy"))
Addendum:
For any regional date formats, you can use the following for the decision:
ToNumber(FormatDate(Today(), "dd")) < 16
------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
RBC
Toronto, Ontario
Canada
