Formula Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to set the default value of a control to be the Sunday date of the
current week and another to be the Saturday date of the current week.
Example: Today's date = 05/17/05, Sun=05/15/05, Sat=05/21/05.
How can this translate into a formula?

Thanks
 
Patricia said:
I want to set the default value of a control to be the Sunday date of the
current week and another to be the Saturday date of the current week.
Example: Today's date = 05/17/05, Sun=05/15/05, Sat=05/21/05.
How can this translate into a formula?
Hi Patricia,

several example "formulas"
(can do one of 2 ways):

12:00 AM of Friday of last week:
DateAdd("d",-1- WeekDay(Date()), Date())
or
Date() -1 - WeekDay(Date())

12:00 AM of Saturday of last week:
DateAdd("d",- WeekDay(Date()), Date())
or
Date() - WeekDay(Date())

=========================
12:00 AM of Sunday of this week:
DateAdd("d", 1 - WeekDay(Date()), Date())
or
Date() +1 - WeekDay(Date())
==========================

12:00 AM of Monday of this week:
DateAdd("d", 2 - WeekDay(Date()), Date())
or
Date() +2 - WeekDay(Date())

<etc.>

12:00 AM of Friday of this week:
DateAdd("d", 6 - WeekDay(Date()), Date())
or
Date() +6 - WeekDay(Date())

=========================
12:00 AM of Saturday of this week:
DateAdd("d", 7 - WeekDay(Date()), Date())
or
Date()+7 - WeekDay(Date())
==========================

12:00 AM of Sunday of next week:
DateAdd("d", 8 - WeekDay(Date()), Date())
or
Date() +8 - WeekDay(Date())

good luck,

gary
 
Back
Top