subtracting days from today's date

M

Mark

Hi all,

I would like to have a query show all records that have
expiration dates which will expire within one month. I
want to use this query with a report. How can I go about
doing this? I am assuming that in the query I can write
something in the criteria of the "ExpirationDate" field...
something like =Now()-60? But what will work?

Thanks for any assistance!!!
 
F

fredg

Hi all,

I would like to have a query show all records that have
expiration dates which will expire within one month. I
want to use this query with a report. How can I go about
doing this? I am assuming that in the query I can write
something in the criteria of the "ExpirationDate" field...
something like =Now()-60? But what will work?

Thanks for any assistance!!!

You have confused me.
You wish to show records that expire within one month.
Is that one month into the future, or (using your Now()-60 as
reference) within 30 days past and 30 days into the future? Or 60 days
past?

Also, one month is not the same as 30 days, so I'll assume you did
mean month.

The date function Now() includes a time value, so unless you do want
records 30 days from today at xx:xx AM, use Date().

Anyway, as criteria in the [ExpireDate] field:
to get one month from today into the future...
Between Date() and DateAdd("m",1,Date())

to get one month from today into the past...
Between Date() and DateAdd("m",-1,Date())

To get one month before and one month after today...
Between DateAdd("m",-1,Date()) and DateAdd("m",1,Date())
 
G

Guest

There is excellent information in the Microsoft Article "Functions for Calculating and Displaying Date/Time Values". I refer to it often.
 

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