Dates and Numbers

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

G'day All

Having a problem with a query im trying to set up in an Access 2002 DB.

I want the query to display all the feild names of work that was done more
than 30 days ago form Now()

So that the difference between Now() and [Date Done] is greater than 30.

Anyone help me on this?

Thanks

Andy
 
Cheers Pieter

I ended up with <Now()-30 which did the trick!
Thanks

Andy


Pieter Wijnen said:
Try

SELECT .... FROM ... WHERE THEDATE < (Date() -30)

Pieter

Andy said:
G'day All

Having a problem with a query im trying to set up in an Access 2002 DB.

I want the query to display all the feild names of work that was done more
than 30 days ago form Now()

So that the difference between Now() and [Date Done] is greater than 30.

Anyone help me on this?

Thanks

Andy
 
Cheers Pieter

I ended up with <Now()-30 which did the trick!
Thanks

Andy

Pieter Wijnen said:
Try

SELECT .... FROM ... WHERE THEDATE < (Date() -30)

Pieter

Andy said:
G'day All

Having a problem with a query im trying to set up in an Access 2002 DB.

I want the query to display all the feild names of work that was done more
than 30 days ago form Now()

So that the difference between Now() and [Date Done] is greater than 30.

Anyone help me on this?

Thanks

Andy

Actually <Now()-30 probably doesn't work properly.
Now() includes a Time value as well as a Date value.
So < Now() - 30 will only return records older than 30 days from the
exact second you ran the query,
i.e. < 4/22/2004 07:29:23 AM

Use Date() which carries the current Date and a Time value of
midnight.
All records < 30 days from today will be returned regardless of the
current time.
 
the reason why i suggested date() instrad of now() is that now() will also
include today (anything entered before the current time ... )

Pieter
fredg said:
Cheers Pieter

I ended up with <Now()-30 which did the trick!
Thanks

Andy

Pieter Wijnen said:
Try

SELECT .... FROM ... WHERE THEDATE < (Date() -30)

Pieter

G'day All

Having a problem with a query im trying to set up in an Access 2002 DB.

I want the query to display all the feild names of work that was done more
than 30 days ago form Now()

So that the difference between Now() and [Date Done] is greater than 30.

Anyone help me on this?

Thanks

Andy

Actually <Now()-30 probably doesn't work properly.
Now() includes a Time value as well as a Date value.
So < Now() - 30 will only return records older than 30 days from the
exact second you ran the query,
i.e. < 4/22/2004 07:29:23 AM

Use Date() which carries the current Date and a Time value of
midnight.
All records < 30 days from today will be returned regardless of the
current time.
 
Back
Top