Re: criteria for date range



You're welcome.

--
Joan Wild
Microsoft Access MVP
"steve goodrich" <stevegoodrich@xxxxxxxxxxxxxx> wrote in message
news:5vGdnYr_p4WB1CzYnZ2dnUVZ8qugnZ2d@xxxxxxxxx
Joan
we get asked for all sorts of dates, today's,tomorrows, next week, next
month. between two dates,etc.
you have answered all my questions and I thank you for that
many many thanks
Steve
"steve goodrich" <stevegoodrich@xxxxxxxxxxxxxx> wrote in message
news:9fKdndab9O233SzYRVnyiAA@xxxxxxxxx
Thanks Joan (think I emailed you in error - sorry)

I was using the same criteria as you suggested but I got it the wrong way
round. I was entering the start date in the "date from" and the end date
in
the "date to"
Which makes me wonder if the "list by date" query I run is setup
correctly.
Would you be so kind as to take a look for me.

I want to be prompted for a single date when I click a command button on
my
form "list by date" which will show me all visitors for that day.
the criteria I have setup is as follows

Date from date to
<=[enter date] >=[enter date]

I am only prompted once for a date, so I can't understand the criteria in
the "date to" field. all I know is that it seems to work (although I've
been
told by other readers that the results may not be correct)
If I remove the criteria from the "date to" field the results are wrong.

Do you think the query is setup correctly?

Many thanks for your time and patience

Steve
"steve goodrich" <stevegoodrich@xxxxxxxxxxxxxx> wrote in message
news:VdidnW23JPTWDC3YnZ2dnUVZ8sOonZ2d@xxxxxxxxx
There are two date fields in my table "date from" and "date to"
The database is used to book visitors into our building
So for example, if mr smith was visiting for the month of June, there
would be one row added to the table with the "date from" being 1st June
and the "date to" being 30th June.
We then run a query daily to pull off the days visitors, using the
following criteria

"date from" "date to"
<=date() >=date()

We also run a query for visitors expected tomorrow with the following
criteria

"date from" "date to"
<=date()+1 >=date()+1

We also get asked to see if a visitor was in the building on certain
days, which is what I am trying to do.
So using mr smith above as an example, i.e. one row in my table for the
month of June, How would I enter my criteria if I wanted to run a query
for say, the 7th to 14th of June.

I tried the criteria below which I thought might work but as usual I was
wrong

"date from" "date to"
<=6/7/06 >=6/14/06

Any help would be very much appreciated

Steve

"Joan Wild" <jwild@xxxxxxxxxxxxxxxx> wrote in message
news:eyqwAkoOHHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Hi Steve, it's not clear to me whether you have two date fields or
one?

If it's one date field and you want to return all records between two
dates then add your date field to the grid and use
Between [Enter start date] and [Enter end date]
as the criteria.

This will prompt the user for the two dates in the range.

If you have two date fields, please explain in more detail (with
perhaps some sample data) what exactly you want returned.

--
Joan Wild
Microsoft Access MVP

"steve goodrich" <stevegoodrich@xxxxxxxxxxxxxx> wrote in message
news:koOdnW7eRI3kADPYnZ2dnUVZ8sylnZ2d@xxxxxxxxx
I have 2 date fields on my form

"date from" and "date to"

I have a parameter query setup so I can list by a date

Date From Date To

<=[enter date] >=[enter date]

Not sure how that works but it does (I enter the date when prompted
in the
"date from" box and the query runs showing starting and ending dates
for
every row.

How should I enter the criteria if I want to select a date range. E.g
date
from 1/1/07 to 1/14/07

Many Thanks

Steve











.