filter 1 week out of a list dates?

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

Guest

What variable or expression would I need to use in my "Date" field to include
ONLY dates in the upcoming week from a list of dates.
 
Date() - WeekDay(Date()) + 1 will give you the Sunday of the current week.
By "upcoming week" I'm not sure if you mean the current week, or the
following week.

If current week:
=Date() - WeekDay(Date()) + 1 And <Date() - WeekDay(Date()) + 8

If the following week, add 7 to each of the integers.

Another possibility would be to use a Calculated Field in the query:
UpcomingWeek: Format([DateField], "wwyyyy")
with the criteria:
Format(Date(), "wwyyyy")

This would be for the current week, use Date()+7 for the following week.
 
Thanks Wayne, that was exactly the formula I was looking for.

Wayne Morgan said:
Date() - WeekDay(Date()) + 1 will give you the Sunday of the current week.
By "upcoming week" I'm not sure if you mean the current week, or the
following week.

If current week:
=Date() - WeekDay(Date()) + 1 And <Date() - WeekDay(Date()) + 8

If the following week, add 7 to each of the integers.

Another possibility would be to use a Calculated Field in the query:
UpcomingWeek: Format([DateField], "wwyyyy")
with the criteria:
Format(Date(), "wwyyyy")

This would be for the current week, use Date()+7 for the following week.

--
Wayne Morgan
MS Access MVP


dazanone said:
What variable or expression would I need to use in my "Date" field to
include
ONLY dates in the upcoming week from a list of dates.
 
Back
Top