Re: day of week function

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 12/15/04


Date: Wed, 15 Dec 2004 11:25:30 -0700

On Wed, 15 Dec 2004 09:41:04 -0800, Melanie O
<MelanieO@discussions.microsoft.com> wrote:

>Is there a function used to determine the Monday of a week given any of the
>days in that week? So if today is 12/15/2004, can I use that as a parameter
>to return 12/13/2004 without hard-coding =Date()-2?

Weekday([datefield]) does this - by default it returns 1 for Sunday, 2
for Monday and so on. There's an optional argument specifying the
first day of the week.

To get the date of the most recent Monday you could use

DateAdd("d", 1 - Weekday(Date(), 2), Date())

                  John W. Vinson[MVP]
             Join the online Access Chats
        Tuesday 11am EDT - Thursday 3:30pm EDT
      http://community.compuserve.com/msdevapps