Query dates older than 90 days?

gojets1721

Registered User.
Local time
Yesterday, 17:03
Joined
Jun 11, 2019
Messages
430
Any idea how to query entries whose date field is older than 90 days from whatever today's date is?

So essentially it'd remove entries with a date between 12/23/2020 - 3/23/2021....then tomorrow it'd filter 12/24/2020 - 3/24/2021 and so on
 
Last edited:
Generally:
yourDate <Date-90
 
Your explanation doesn't jive with your examples. So, here's SQL for the 2 things you asked for:


Any idea how to query entries whose date field is older than 90 days from whatever today's date is?

SELECT *
FROM YourTableNameHere
WHERE YourFieldDate>(Date()+90)

So essentially it'd filter out entries with a date between 12/23/2020 - 3/23/2021

SELECT *
FROM YourTableNameHere
WHERE (YourFieldDate<(Date() -90)) OR (YourFieldDate>Date())
 
Your explanation doesn't jive with your examples. So, here's SQL for the 2 things you asked for:




SELECT *
FROM YourTableNameHere
WHERE YourFieldDate>(Date()+90)



SELECT *
FROM YourTableNameHere
WHERE (YourFieldDate<(Date() -90)) OR (YourFieldDate>Date())
Sorry...basically I don't want ones within the past 90 days to appear in the query

I inputted this sql but I'm getting no entries appearing

Code:
SELECT *
FROM EmployeeList
WHERE (((EmployeeList.[Hire Date])>(Date()+90)));
 
Date() + 90 is 21/06/2021 (Proper date format ) ;)

That is 90 days in the future. I think you want a different calculation.

As Plog stated
Try WHERE (YourFieldDate<(Date() -90)) OR (YourFieldDate>Date())
 

Users who are viewing this thread

Back
Top Bottom