AJITH_SK
(AJITH KUMAR )
July 25, 2024, 3:48pm
1
Today date is 07/25/2024
I expected Output is 3.
Reason is already this month 3 Friday went.
July -5 Friday
July - 12 Friday
July - 19 Friday
Output 3
Tomorrow I will check 07/26/2024
I expected Output is 4
Reason is already this month 3 Friday went.
July -5 Friday
July - 12 Friday
July - 19 Friday
July - 26 Friday
vrdabberu
(Varunraj Dabberu)
July 25, 2024, 3:50pm
2
Hi @AJITH_SK
inputDate = DateTime.Parse("07/25/2024")
fridaysCount = Enumerable.Range(1, inputDate.Day).
Count(Function(day) New Date(inputDate.Year, inputDate.Month, day).DayOfWeek = DayOfWeek.Friday)
Regards
postwick
(Paul Ostwick)
July 25, 2024, 3:56pm
3
One way to do it using activities:
1 Like
vrdabberu
(Varunraj Dabberu)
July 25, 2024, 3:58pm
4
Hi @AJITH_SK
Check the below flow for better understanding:
If input Date is 07/25/2024
inputDate = DateTime.Parse("07/25/2024")
fridaysCount = Enumerable.Range(1, inputDate.Day).
Count(Function(day) New Date(inputDate.Year, inputDate.Month, day).DayOfWeek = DayOfWeek.Friday)
If input Date is 07/26/2024
inputDate = DateTime.Parse("07/26/2024")
fridaysCount = Enumerable.Range(1, inputDate.Day).
Count(Function(day) New Date(inputDate.Year, inputDate.Month, day).DayOfWeek = DayOfWeek.Friday)
The same syntax will work for both the dates and print the expected output.
Let me know if you have any issues.
Regards
rlgandu
(Rajyalakshmi Gandu)
July 25, 2024, 4:02pm
5
@AJITH_SK
Enumerable.Range(1, today.Day).Count(Function(day) New DateTime(today.Year, today.Month, day).DayOfWeek = DayOfWeek.Friday)
Please Try this
rlgandu
(Rajyalakshmi Gandu)
July 25, 2024, 4:17pm
9
@AJITH_SK
Try to remove Microsoft.Graph Namespace from Import panel
vrdabberu
(Varunraj Dabberu)
July 25, 2024, 4:28pm
10
Hi @AJITH_SK
Please go to Imports Panel right click on Microsoft.Graph namespace and Delete it your error will be gone.
Regards
ppr
(Peter Preuss)
July 25, 2024, 4:31pm
11
As mentioned in the error, it is ambigious so make it more qualified:
System.DayOfWeek.Friday
1 Like
vrdabberu
(Varunraj Dabberu)
July 25, 2024, 5:13pm
14
Hi @AJITH_SK
You can try the below syntax without removing Microsoft.Graph from Imports Panel since once that particular namespace is imported you can’t delete that namespace.
Enumerable.Range(1, inputDate.Day).Count(Function(day) New Date(inputDate.Year, inputDate.Month, day).DayOfWeek = System.DayOfWeek.Friday)
Hope you understand!!
Regards
1 Like
system
(system)
Closed
July 28, 2024, 5:14pm
15
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.