How do you create a before and after date query?

  • Thread starter papasmurf via AccessMonster.com
  • Start date
P

papasmurf via AccessMonster.com

I am working on getting my vacations tables to work better.

What I am trying to do is to get a query for the 'StartDate' of staff
vacations.

There can be between 3 - 7 weeks of vacation for staff, with each week having
it own 'StartDate'.

The 'TBL-Vacation-2007' has seven 'StartDate' fields. (Start-1, Start-2, etc.)
all in date/time format.

I have created queries that will select only 'not null' entries in each
'StatDate' field, and append them together to create a table called:

table: "VacStartDate" fields: "Name" , "StartDate"

so all the data is together.

What I am now trying to do is to set up a query on this table, that a date
can be entered, and result will be any start dates seven days before and
after.

I have tried creating a "Between [input date] And [input date]" which does
work, but for work purposes I have to able to enter a date(Sunday) and be
able to find out something like
"Date()-7 and Date()+7".
But I am looking for way to input a date, something like "Date([Input Date])-
7 and Date()+7" but it does not work right.

Can anyone help me?

Thank you
 
S

Steve

Your table design is not correct. You need:
TblStaff
StaffID
StaffFirstName
StaffMI
StaffLastName
<Other staff fields as needed>

TblStaffVacation
StaffVacationID
StaffID
StartDate
EndDate

You can enter, edit, delete and view staff vacations in a form/subform where
the main form is based on TblStaff and the subform is based on
TblStaffVacation. You can use the form wizard to create the form/subform.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 

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