Work out the previous Sunday



Is there a way I can work out the previous Sundays date. Throughout the week my automation will run and I need to be able to enter in Sundays date each time.


Date PreviousMonths FirstDayofWeek and LastDayOfWeek

How about getting DayOfWeek number by using Weekday() function (If it’s Sunday it returns 1 and if Saturday it returns 7).
Then you need just add 7 to current date when it’s Sunday, or you’ll need to add 6 if it’s Monday.

Like this:
nextSunday = Today.AddDays(8 - Weekday(Today))

With following example you can get next Sunday of any input date.

get date of next (2.3 KB)


Building on what @a-Taniya has stated, if you wanted to acquire the previous Sunday’s date you could use:
Today.AddDays(- (Weekday(Today) - 1))

26/06/17 - (2 - 1) = 25/06/17


Thanks Mr_JDavey, I was mixed up while crafting sample flow! :sweat_smile:


Thanks for the reply. It worked great. Thanks.