Date Difference Help

T

TD

I want to write a query that will display all records from my database that
are over 365 days for a field that I have named "Posted Date". Can someone
guide me in the right direction please.

Thanks,
TD
 
G

Guest

TRY DateDiff([posted date],date()) in a query.
in criteria use >365

Post Date being the day of posting and date() being
current date.

Hope it helps
 
D

Duane Hookom

Actually the expression should be:
DateDiff("d",[Posted Date], Date())

--
Duane Hookom
MS Access MVP


TRY DateDiff([posted date],date()) in a query.
in criteria use >365

Post Date being the day of posting and date() being
current date.

Hope it helps
-----Original Message-----
I want to write a query that will display all records from my database that
are over 365 days for a field that I have named "Posted Date". Can someone
guide me in the right direction please.

Thanks,
TD





.
 
G

Guest

I appologise, you are absolutely correct.
-----Original Message-----
Actually the expression should be:
DateDiff("d",[Posted Date], Date())

--
Duane Hookom
MS Access MVP


TRY DateDiff([posted date],date()) in a query.
in criteria use >365

Post Date being the day of posting and date() being
current date.

Hope it helps
-----Original Message-----
I want to write a query that will display all records from my database that
are over 365 days for a field that I have
named "Posted
Date". Can someone
guide me in the right direction please.

Thanks,
TD





.


.
 
D

Douglas J. Steele

And I suspect it would be more efficient to set the criteria for [Posted
Date] to < DateAdd("yyyy", -1, Date()), so that you don't need to do the
calculation on each row.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Duane Hookom said:
Actually the expression should be:
DateDiff("d",[Posted Date], Date())

--
Duane Hookom
MS Access MVP


TRY DateDiff([posted date],date()) in a query.
in criteria use >365

Post Date being the day of posting and date() being
current date.

Hope it helps
-----Original Message-----
I want to write a query that will display all records from my database that
are over 365 days for a field that I have named "Posted Date". Can someone
guide me in the right direction please.

Thanks,
TD





.
 
B

Bob Stevens

-----Original Message-----
I want to write a query that will display all records from my database that
are over 365 days for a field that I have named "Posted Date". Can someone
guide me in the right direction please.

Thanks,
TD
 
Top