How to find files older than x days on Windows using Advanced Query Syntax (AQS)?
You can find files older than this week using
datemodified:< this week
but
datemodified:< 7 days
does not seem to work.
How to find files older than x days on Windows
datemodified:< 7 days
doesn't seem to work.
When referring to relative date 'values' using the <
or >
the value cannot be any of the keyword values related to dates (listed below). It must be a value using the format dd/mm/yy
(or whatever format is specified in the "Region and Language" settings.
To find files older than x
days, use the following:
datemodified:< dd/mm/yy
where dd/mm/yy
is x
days before the current (today's) date.
Notes:
When entering dates use the date format which matches the "Control Panel" > "Region and Language" settings.
There is one exception to this, years should always be entered as 4 digits.
Searching using filters
Here are examples of the supported date related filters
Criteria Syntax/Example
Date created (exact date) datecreated:8/2/2012
Date created (range) datecreated:8/2/2012..8/3/2012
Date created (before) datecreated:<8/2/2012
Date created (after) datecreated:>8/2/2012
Date created prior to the current year datecreated:a long time ago
Date created within the current year datecreated:earlier this year
Date created within the current month datecreated:earlier this month
Date created within the current week datecreated:earlier this week
Date created yesterday datecreated:yesterday
Date created today datecreated:today
Date modified (exact date) datemodified:8/2/2012
Date modified (range) datemodified:8/2/2012..8/3/2012
Date modified (before) datemodified:<8/2/2012
Date modified (after) datemodified:>8/2/2012
Date modified prior to the current year datemodified:a long time ago
Date modified within the current year datemodified:earlier this year
Date modified within the current month datemodified:earlier this month
Date modified within the current week datemodified:earlier this week
Date modified yesterday datemodified:yesterday
Date modified today datemodified:today
Source Windows 7 search explained
Keyword values related to dates
The following keywords can be user when referring to dates.
Relative dates: Today, tomorrow, yesterday
Multi-word relative dates: week, next month, last week, past month, or coming year.
The values can also be entered contracted, as follows: thisweek, nextmonth, lastweek, pastmonth, comingyear.
Days: Sunday, Monday ... Saturday
Months: January, February ... December
Source Using Advanced Query Syntax To Find Files in Windows 7
Further reading
- Windows 7 search explained
- Using Advanced Query Syntax To Find Files in Windows 7