Can a parameter query display a date plus 5 days ahead?

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

Guest

I want a query to display a weeks worth of data from the week beginning date.
I don't use visual basic. Can this be done and does anyone know how? I'm
using Access 2003.
 
If you are using a parameter you could try criteria that looked like
Do you want 5 days or do you want a week (7 days)? Assuming 5 based on the
subject

Between CDate([Input Start Date]) and DateAdd("d",4,[Input Start Date])

Assuming a week (7 days)
Between CDate([Input Start Date]) and DateAdd("d",6,[Input Start Date])

That assumes that the date field you are checking does not have any added
times to it.

If you mean you want to get the data for the current week(starting with
Sunday and ending with Saturday).
Between DateAdd("d",1-Weekday(Date()),Date()) and
DateAdd("d",7-Weekday(Date()),Date())

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
ADyas said:
I want a query to display a weeks worth of data from the week beginning date.
I don't use visual basic. Can this be done and does anyone know how? I'm
using Access 2003.


Sure, just use your parameter in an expression (e.g.
DateAdd("d", 5, [Enter Week Start Date])

If you want to filter a date field, the criteria xould be
like:

Between [Enter Week Start Date] And DateAdd("d", 5, [Enter
Week Start Date])
 
Back
Top