Today + 10

  • Thread starter Thread starter Judy
  • Start date Start date
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
 
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.
 
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)

:-)
 
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.<<


.
 
Back
Top