Query to show current employees between dates

B

bhx_uk

Hello,

I am desperately trying to make a query that will show the current
employee's of our organisation between 2 dates (One is a fixed date using the
#01/01/1900#, the other is a variable).

I have the following key fields that i think are important ones. They are
Start Date, Termination Date, Current Employee.

My knowledge of Access is limited at best, i have used the NOT and Between
functions, so far all these do is show employees that are listed as
"Employee" and "Ex Employee".

Does anyone have any ideas on how i can gain access to this info?
 
L

Lord Kelvan

you have a field that is current employee is the a yes/no field or
what because thats the key

and also you have employees that are 108 years old i am quite
impressed ^_^

try

select *
from employee
where [start date] between #01/01/1900# and now()
and [current employee] = true

or

select *
from employee
where [termination date] is null

to be honest you dont need to have a field for current employee
because termination date determines that

also why between 01/01/1900 and now or are you trying to do a query
that will give you all employees between two dates so if you wanted to
know all employees between 1900 and 1920

if so then try

select *
from employee
where ([termination date] between 01/01/1900 and [enter date])
or ([start date] between 01/01/1900 and [enter date] and [termination
date] is not null)

as i said the current employee field is nor relevant because of
termination date
hope this helps

Regards
Kelvan
 

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