DateDiff - Creating Query based on Aging

C

Carmi

Hi -

I'm trying to determine how to create a Query based on a date field for
records over 45 days old.

here is the formula I started with in the Design Form: Date Field:
Criteria
DateDiff("d",[Date_of_Service],Date())

How can I get the Query to only return records over 45 days from Date
of Service?

I hope I provided enough information.

Thanks for your help,

Carmi
 
R

Rick B

Your formula is correct, but it does not go in the criteria. It goes in a
new column in your query. This column will then return the age in days.
Your criteria would then be...


In a new column, put the following as your "Field:"

AgeInDays: DateDiff("d",[Date_of_Service],Date())

Then in the criteria under it put...


--
Rick B



Carmi said:
Hi -

I'm trying to determine how to create a Query based on a date field for
records over 45 days old.

here is the formula I started with in the Design Form: Date Field:
Criteria
DateDiff("d",[Date_of_Service],Date())

How can I get the Query to only return records over 45 days from Date
of Service?

I hope I provided enough information.

Thanks for your help,

Carmi
 
C

Carmi

Thank you, this helped greatly. I also added an If statement to and
got what I wanted. Thanks again, Carmi
 
C

Carmi

Thank you, this helped greatly. I also added an If statement to and
got what I wanted. Thanks again, Carmi
 

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