Picking up Week Ending data

A

Alex Martinez

Hi,

I am using Access 2002 I have a database that gets populated every Friday
the fields involved are (Name, Days Worked, Week Ending) for example: Name
= John Doe Days Worked = 5 (5 working days), and Week Ending (9/2/2005).
What I like to have is a parameter query so when a user inputs a date let's
say 9/2/2005 I will have all the data (Names, Days Worked, and Week Ending)
from 9/2/2005 week to the last three previous weeks the user putted. For
example: user inputs 9/2/2005 week I want to caputre the data from week
ending 9/2/2005, 8/26/2005, 8/19/2005, & week ending 8/12/2005. My question
how do I do this? Any help will be appreciated, thank you.

Regards,
 
E

Eric D via AccessMonster.com

On your form, where the user enters the date, I imagine you have a submit
button.
Add VBA to the OnClick of this button that uses the DateAdd Function.
CalcDate = DateAdd ("ww", -3, DateEnteredByUser) should give you what you're
looking for.
Then pass this to your query as a Date parameter - [Between CalcDate and
DateEnteredByUser].
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top