Parameter Query based on parameters from another Query

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

Guest

Right now I have a parameter query where the user enters a start and end date
of a week and it finds all records in that week. I need to make another
query that will find all records from the week before those records that are
in the first query.

Any suggestions?

-Chris
 
Select * from YourTable
where theDate between DateAdd ("d", -7, [Week Beginning Date]) and
DateAdd("d", 7, [Week Beginning Date]);

Assumes a 7 day week and that you want results for both weeks back at one
time.
Also removes the need for the End of Week prompt.

Good Luck!
 
But That wasn't really what I was going for.....kind of, but not totally.

Here is my situation in greater detail...

I have one query already that is a parameter query so when it runs, you must
enter the beginning and end date of your week you want. When that query
runs, I want another query, or someting like it, to look at the date the user
entered, determine what one week before those dates is, and run another query
to make a separate table.

So you end up with two tables, one with the data from the requested week,
and one with the data from the week before the requested date.

Thanks,
Chris

Chaim said:
Select * from YourTable
where theDate between DateAdd ("d", -7, [Week Beginning Date]) and
DateAdd("d", 7, [Week Beginning Date]);

Assumes a 7 day week and that you want results for both weeks back at one
time.
Also removes the need for the End of Week prompt.

Good Luck!
--
Chaim


Chris said:
Right now I have a parameter query where the user enters a start and end date
of a week and it finds all records in that week. I need to make another
query that will find all records from the week before those records that are
in the first query.

Any suggestions?

-Chris
 
Back
Top