Hi,
I need to assign a date to the weeks starting with Sunday. Let's say 6/26/2020 should be 6/21/2020. For date July st, it should be 06/28/2020. I care here about starting week Sunday than the actual date. Any idea how to accomplish it?
Solved! Go to Solution.
Hi @magsbiel, I put together a quick sample solution to help adjust a given date to its corresponding start of the week (Sunday).
I hope this help.s
Similar to @AbhilashR's solution, you can also use the date specifier %w to get the weekday number, where Sunday is 0 and Saturday is 6:
datetimeadd(
[original_date],
-tonumber(datetimeformat([original_date], '%w')),
'day'
)