You can use the Weekday function which, by default, returns 1 for Sunday, 2
for Monday and so on up to 7 for Saturday. Knowing which day it is, you can
easily figure out how many days you need to subtract for the previous
Sunday, or add for the following Saturday.
The format() function will return the day of week as a number 1 to
7 when given the "w" option. To get the saturday, use the dateadd()
function to increase the date by the number needed.