Using Max/Last in Query

J

J. Trucking

Hello,

I have a tabel which shows how many days of holidays an employee is
entitled to. It shows the date the amount was established as well as
the value itself. This is to track changes throughout the employement
(ie) an increase in vacation time as the years of service increase.
For example, the table may look something like this for an individual
employee:

01/01/05 14 Days
01/01/07 21 Days

So here's my question: I would like to set up a query which will do
calculations using the vacation value for a given time period. If my
time period is 01/01/08 - 05/01/08, I would like the query to use 21
Days. I think I can accomplish this using Last/Max. What I need help
with is if there are two values within a given time period. For
example, if the user selects 01/01/04 - 01/01/08 as the time period,
it would encompass two different values for holidays. If this
happens, I just want the value to show some sort of sentence that says
"More than one value - Please seperate Time periods). Is this
possible within the query?

Thanks in advance,

John
 
S

strive4peace

Hi John,

Last is fairly useless (just gets the last value entered with no
particular order) ... what you would use in most instances is Max

that said ...

01/01/07 is not between 01/01/08 - 05/01/08 ... so I am a little
confused by your request

Can you be more clear about what you are looking for?

"if the user selects 01/01/04 - 01/01/08 as the time period"

how are you collecting the time period? on a form?

Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
J

J. Trucking

Hi Crystal,

Thanks for the response. I do collect the data on a form. I have
built a search form that when a user enters in a date range and clicks
a command button, a report opens.

John
 

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