Given a date, find the date of the previous Sunday.

Category:
Dates and Math
Type:
Snippets
Difficulty:
Beginning
Author:
Toby Herring

Version Compatibility:

More information:
This function uses the intrinsic DatePart and DateSerial functions. Given any date, it will return a Date-type variable containing the date of the Sunday beginning that week. (If the argument passed is a Sunday, _that_ Sunday, not the previous Sunday, will be returned.) Good for programs that organize data by the week, with weeks starting on Sunday.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: