filtering query to show only future dates

M

martinmike2

Hello,

I have absolutly no idea how to accomplish this.

I need a query that will show only records containing dates in the
future and ignore any records that contain dates of the current date
and back (the past).

Any ideas?
 
K

Ken Sheridan

In the 'criteria' row of the date column in query design view put:

Be sure your date column is not named Date. As you see this is the name of
a built in function which returns the current date, so having a column of the
same name could cause confusion.

One caveat: if any rows have date/time values in the column with the current
date and a non-zero time of day they would be returned. There is no such
thing as a date value per se in Access only a date/time value. A date
entered as a date without any time of day is in fact midnight at the start of
the day in question. You can cover this possibility by using a criterion of:
=DateAdd("d",1,Date())

Unless you are absolutely certain that your date column contains only dates
with a zero time of day I'd recommend using the latter criterion; you don't
lose anything by doing so other than perhaps a minor performance reduction
arising from the additional function call. Remember that if the column is
formatted in a date format you won't see the time of day , even if it is
non-zero. The only real way to be sure is if the table definition prohibits
values with non-zero times of day.

Ken Sheridan
Stafford, England
 

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