Calculating Dates

M

Melinda

I have several queries wrote where I have set the criteria to input the
[beginning date]and[ending date] and I want to capture all the data in
between. I also have a lookup field that allows me to select the Pay Period
Ending. Is there a way to query on the [Pay Period Ending] field -14 days.
I thought this might be easier since the end user always knows the Pay Period
Ending Date if it would automatically caputre all data 14 days prior to that.
 
K

KARL DEWEY

I want to capture all the data in between.
This will capture all the data in between.
Between [beginning date] And [ending date]
Is there a way to query on the [Pay Period Ending] field -14 days.
Between [Enter Pay Period Ending] -14 And [Enter Pay Period Ending]

Melinda said:
I have several queries wrote where I have set the criteria to input the
[beginning date]and[ending date] and I want to capture all the data in
between. I also have a lookup field that allows me to select the Pay Period
Ending. Is there a way to query on the [Pay Period Ending] field -14 days.
I thought this might be easier since the end user always knows the Pay Period
Ending Date if it would automatically caputre all data 14 days prior to that.
 
J

Jeff Boyce

Melinda

In your query, in design mode, select the [Pay Period Ending] field along
with your other fields.

In the Criteria beneath that field (assuming it is a date field), put
something like the following:

Between [Period Ending Date] - 14 And [Period Ending Date]

Yes, both of those parameters are identical. This way, Access will only
prompt once.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Melinda

At the present I am capturing all the data by prompting the end user to enter
the [beginning date]and[ending date]. I thought possibly there might be a
way to set the query up to capture all the data by just prompting them to
enter[pay period endingdate] and the query would calculate the 14 days of
overtime earned --14 days prior to pay period ending. Kind of confusing I
know. The query is working as it is, but it just seems like I should be
able to eliminate some of the parameters.

Thanks

KARL DEWEY said:
This will capture all the data in between.
Between [beginning date] And [ending date]
Is there a way to query on the [Pay Period Ending] field -14 days.
Between [Enter Pay Period Ending] -14 And [Enter Pay Period Ending]

Melinda said:
I have several queries wrote where I have set the criteria to input the
[beginning date]and[ending date] and I want to capture all the data in
between. I also have a lookup field that allows me to select the Pay Period
Ending. Is there a way to query on the [Pay Period Ending] field -14 days.
I thought this might be easier since the end user always knows the Pay Period
Ending Date if it would automatically caputre all data 14 days prior to that.
 
Top