cancel
Showing results for 
Search instead for 
Did you mean: 

Get week number for month using date

Anonymous
Not applicable
Hi Can anybody please help me in getting week number for particular month without using any code stage? For Example : 02/05/2018(MM/DD/YYYY) --- Week 2
6 REPLIES 6

SachinBais
Level 4
Try to use calendars  object      i am not sure about it but yes you can give it a chance ....please let me know if you get succeed in this ....

John__Carter
Staff
Staff
Could you not work it out mathematically, based on the which day of the week is the 1st (and which day you define as the start of the week)?

DavidEdwards-Da
Level 5
Why does this need to be done without code stages? Code stages exist for the exact reason of extending Blue Prism functionality when built-ins aren't appropriate?

NikhilSaini
Level 3
Hi,   Please find the C# code which is working for me. You need to all system.Globalization dll and same in namespace.   DateTime time=Date_Input;       DayOfWeek day = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time);     if (day >= DayOfWeek.Monday && day

JohnMartin1
Level 2
Hi,
Did you get a solution for this? I am looking for the exact same solution. Any ideas?

------------------------------
John Martin
Automation test analyst
TD
America/Toronto
------------------------------

Hi John,

For this you can write a completely new VB .NET code stage and well get the results. I can suggest you that but keeping the integrity of the above thread intact that says in particular to not use any code stage and get the result, the best approach I can think of is to create a handy excel template with you where you can have write the cell value let's say 'A1' as the date from where you need to find the week number and in the same excel you can have a formula ready before even automating it via Blue Prism, let say 'A2' with the formula as: =WEEKNUM(A1)

So essentially what you are gonna do is, you will write the date in the excel cell 'A1' and then you will fetch the calculated formula value from the cell 'A2' to get your desired week number. This is probably the easiest way to go around!

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.