How would I do this?

M

Marc

I'm doing a query to find people who are currently on travel. I have a field
of "Date Started" and one for "Date Returning." Where in the query and how
would I determine if today is between those dates?
 
J

Jeff Boyce

Marc

One approach might be to use something like the (untested) following:

under the [DateStarted], as a criterion --
<=Date()

under the [DateReturning], as a criterion --

That should find records with start dates on/before today's date, and end
dates on or after today's date.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

I'm doing a query to find people who are currently on travel. I have a field
of "Date Started" and one for "Date Returning." Where in the query and how
would I determine if today is between those dates?

I expect you have entered a DateStarted and a future DateReturning
value when they leave.
It doesn't matter if today is 'between' those dates, only that it is
not yet the DateReturning.

As criteria on the DateReturning field (in a query):
Date() or perhaps if you wish
=Date()

How does your database handle someone who was scheduled back on 7/3
but actually came back on 6/29? According to your current database
design, they're not here but yet they are.
 
J

John W. Vinson

I'm doing a query to find people who are currently on travel. I have a field
of "Date Started" and one for "Date Returning." Where in the query and how
would I determine if today is between those dates?

Put a criterion of

<= Date()

on [Date Started], and

on [Date Returning].
 

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