Today + 10

J

Judy

I know today's date is date()

I need to check for fields falling between today's date
and 10 days from now.

What's the expression for that?


Thanks,

--Judy
 
R

Rick Brandt

Judy said:
I know today's date is date()

I need to check for fields falling between today's date
and 10 days from now.

What's the expression for that?

BETWEEN Date() AND Date() + 10

or

BETWEEN Date() AND DateAdd("d", 10, Date())

If the field your doing the comparison on includes time you will likely need to add
11 days rather than 10 as you will only get records on the last day with exactly
midnight as the time.
 
B

Bruce M. Thompson

What's the expression for that?
BETWEEN Date() AND Date() + 10

or

BETWEEN Date() AND DateAdd("d", 10, Date())

If the field your doing the comparison on includes time you will likely need to add
11 days rather than 10 as you will only get records on the last day with exactly
midnight as the time.

Actually, you can easily overcome that by using the "DateValue()" function to
drop the "time" portion of the date:

WHERE (DateValue([MyDateField]) BETWEEN Date() AND Date() + 10)

:)
 
J

Judy

Thanks--that'll work.

--Judy
-----Original Message-----
BETWEEN Date() AND Date() + 10

or

BETWEEN Date() AND DateAdd("d", 10, Date())

If the field your doing the comparison on includes time
you will likely need
to add
11 days rather than 10 as you will only get records on
the last day with
exactly
midnight as the time.

Actually, you can easily overcome that by using the "DateValue()" function to
drop the "time" portion of the date:

WHERE (DateValue([MyDateField]) BETWEEN Date() AND Date () + 10)

:)
--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)within the newsgroups so that all might benefit.<<


.
 

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