Hey @anjani_priya
Please try this!
- Add a do while loop.
- Add selecting the date part inside the loop and extract the text below From Date.
finalDate = New DateTime(Now.Year, Now.Month, 1).AddDays(-1) - After that add a if condition and check whether the text you extracted is same as No Reference Rate Found.
- If that is same then decrement the date inside the if condition and assign to the date variable.
Note: You can change the if condition in such a way that if that particular date is sat or sun it will consider the previous day.
finalDate = DateTime.Parse(finalDate).AddDays(-1).ToString()
Add one more if statement with the condition DateTime.Parse(finalDate).DayOfWeek = DayOfWeek.Saturday OrElse DateTime.Parse(finalDate).DayOfWeek = DayOfWeek.Sunday
If this is true then again decrement the date
finalDate = DateTime.Parse(finalDate).AddDays(-1).ToString()
Here the finalDate is String variable
- For the do while loop add a condition saying extracted text is not equal to No Reference Rate Found.
So this will decrement the date untill the extracted text does not contain No Reference Rate Found.
Hope this helps!


