Query dates 30 days or older

O

Octet32

How do I make a query run only dates 30 days or older, I think I need a if
statement
Something with like this in it < Date - 30 I will be running this query
every day

can anyone tell me how to write this?

Octet
 
S

Stefan Hoffmann

hi,
How do I make a query run only dates 30 days or older, I think I need a if
statement
Something with like this in it < Date - 30 I will be running this query
every day
Yes, that's it.
can anyone tell me how to write this?
You just have to put this string into your date column in the query
designer. Just place it in the criteria row.


mfG
--> stefan <--
 
B

BruceM

Simplify. In the criteria row for the field (query design view):
< Date() - 30
Note that the DateAdd function will give you more flexibility, in case for
instance you want to use a month rather than 30 days:
< DateAdd("m",-1,Date())

By the way, when something does not work, be specific about what happens
instead of the expected result. It will help somebody to provide an
accurate answer.

Octet32 said:
I tryed this iif([Date Diverted] = "< Date - 30 ") but it does not work

Stefan Hoffmann said:
hi,

Yes, that's it.

You just have to put this string into your date column in the query
designer. Just place it in the criteria row.


mfG
--> stefan <--
 
O

Octet32

Thats great,
Thanks

BruceM said:
Simplify. In the criteria row for the field (query design view):
< Date() - 30
Note that the DateAdd function will give you more flexibility, in case for
instance you want to use a month rather than 30 days:
< DateAdd("m",-1,Date())

By the way, when something does not work, be specific about what happens
instead of the expected result. It will help somebody to provide an
accurate answer.

Octet32 said:
I tryed this iif([Date Diverted] = "< Date - 30 ") but it does not work

Stefan Hoffmann said:
hi,

Octet32 wrote:
How do I make a query run only dates 30 days or older, I think I need a
if
statement
Something with like this in it < Date - 30 I will be running this query
every day
Yes, that's it.

can anyone tell me how to write this?
You just have to put this string into your date column in the query
designer. Just place it in the criteria row.


mfG
--> stefan <--
 

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