Connecting Tech Pros Worldwide Forums | Help | Site Map

Date Criteria in a query

ljn
Guest
 
Posts: n/a
#1: Nov 13 '05
Hello,

I'm trying to build a query to retrieve all records where a certain
date is older than 120 days. I tried doing > 120 in the critera box
for that date, but it's not working. Any ideas?

Thanks!


fredg
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Date Criteria in a query


On 22 Jun 2005 13:20:23 -0700, ljn wrote:
[color=blue]
> Hello,
>
> I'm trying to build a query to retrieve all records where a certain
> date is older than 120 days. I tried doing > 120 in the critera box
> for that date, but it's not working. Any ideas?
>
> Thanks![/color]

You have to fist tell it >120 from what!!

Add a new column to the grid.
Exp:Date() - [DateField]

As criteria for this column, write[color=blue]
>120[/color]
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Lisa Nordstrom
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Date Criteria in a query



Thanks for the reply. The date I want to query on is a ReceivedDt. I
figured it out by using DateAdd. In the criteria block for that field
in the query I put:

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

And that worked. I think I may have been better off using 4 months, but
the exact date isn't critical. Just the fact that the records were 4
months old and a certain action had not been taken.

Again, thanks for the reply.
Lisa


- Way out of practice with Access

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread