Date Difference Help

  • Thread starter Thread starter TD
  • Start date Start date
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
 
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
 
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





.
 
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





.


.
 
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





.
 
-----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
 
Back
Top