Past Due 30 days by Now

K

Kat

I need to create a query to show me all orders that are 30 days old from the
day I run the report. I really don't even know where to start. My guess is
I have to calculate it in Ship Date to be less than 30days from Now. But I
don't know what the formula should look like.
 
F

fredg

I need to create a query to show me all orders that are 30 days old from the
day I run the report. I really don't even know where to start. My guess is
I have to calculate it in Ship Date to be less than 30days from Now. But I
don't know what the formula should look like.

Your question "orders that are 30 days old from the day" and "to be
less than 30 days from Now" is not clear.
Do you wish to return records from 30 days AGO to the current date?
As criteria on the DateField, write:
Between DateAdd("d",-30,Date()) and Date()

Do you wish to return records from the current date to 30 days in the
FUTURE?
Between Date() and DateAdd("d",30,Date())

Do you wish to return records that are EXACTLY 30 days in the past?
As criteria on the DateField, write:
Date()-30

Do you wish to return records that are EXACTLY 30 days in the future?
As criteria on the DateField, write:
Date() + 30

Do you wish to return records that are MORE than 30 days in the past?
As criteria on the DateField, write:
<Date()-30

Be careful when wanting to use the Now() function to filter dates.
Now() includes a Date and Time value and therefore you may get
different results, depending upon the time of day you run the query.
Date() includes just the Date (the Time value is always midnight).
 
T

tkelley via AccessMonster.com

Criteria in your Ship Date field:

< Date() - 30
I need to create a query to show me all orders that are 30 days old from the
day I run the report. I really don't even know where to start. My guess is
I have to calculate it in Ship Date to be less than 30days from Now. But I
don't know what the formula should look like.
 
J

John Spencer (MVP)

Not a lot to go on. This should give you all records where the ship date is
more than 30 days prior to today's date.

FIELD: Ship Date
CRITERIA: < DateAdd("d",-30,Date())

Somehow that doesn't seem to me to indicate that something is past due.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John W. Vinson

I need to create a query to show me all orders that are 30 days old from the
day I run the report. I really don't even know where to start. My guess is
I have to calculate it in Ship Date to be less than 30days from Now. But I
don't know what the formula should look like.

Actually Now() is the current date and time, accurate to the second. Today's
date is Date(), not Now().

You can put a criterion on ShipDate of

< DateAdd("d", -30, Date())

to find all records where shipdate is prior to thirty days ago.
 

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