How to store previous weeks sunday date from current date in string variable in below format MM/dd/yyyy
For example we need the previous weeks sunday date : 04/16/2023
How to store previous weeks sunday date from current date in string variable in below format MM/dd/yyyy
For example we need the previous weeks sunday date : 04/16/2023
Hi,
Can you try the following expression?
Today.AddDays(-7-CInt(Today.DayOfWeek))
Regards,
As an alternate
YourDateTimeVar.addDays(-{7,1,2,3,4,5,6}(YourDateTimeVar.DayOfWeek)).toString("MM/dd/yyyy")
in the array you can configure the offset for each day in week (sun=0, mon=1…sat=6)
in case on a Satruday the same day should be used set it from 7 to 0
Hi @Sathish_Kumar_S ,
You can use Modify Date activity to get previous Sunday. By providing input as Now.AddDays(-7) you can get previous weeks Sunday.
Output will be in DateTime. You can add a assign activity to convert it to string as shown above.
Hope it helps.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.