Windows Search’s Advanced Query Syntax (AQS) can be used to narrow or pinpoint your searches in Windows. Searches can be narrowed by file type, kind, file property, file extension, date, and other parameters. This post tells you how to use Windows Search to find files created, accessed or modified within a given date range, in all versions of Windows including Windows 10.
Search for files & folders in a given date range
To search for files and folders modified between two given dates, use this query syntax:
datemodified:4/1/2019 .. 4/15/2019
This lists files modified from April 1 → April 15, 2019.
How did I know that query string, and how to use GUI to select a date range?
In the Search box, type one of these query syntaxes:
date: datemodified: dateaccessed: datecreated: datetaken:
datetaken: is for your photos taken from a camera. Windows Search queries the Date field from the file’s EXIF info.
Once you type that, you’ll be presented with the date picker dialog box which looks like this:
In this dialog, select the start date → Hold the Shift key down → select the end date. This creates a date range.
You can also use Shift with the arrow keys ( ← ↓→ ↑) on your keyboard to select a date range.
To go back to the earlier years, click on the month in the date picker.
Or go even another level up, month-wise.
And further up, year-wise:
One of the 8 preset options can also be selected, via the Date Modified ribbon control or via the date picker interface:
- This week
- Last week
- This month
- Last month
- This year
- Last year
Once you select a date range, the corresponding query string is populated in the search box. For example:
datemodified:4/1/2016 .. 4/15/2016
You can also find files modified between two given dates using the following syntax:
To find files that were created between two dates, use the datecreated: operator.
To only find text documents (.txt) that were created or modified after a certain date (5/1/2019), you use:
AQS Search by date syntax
|Search Criteria||Advanced Query Syntax|
|Created before an exact date||datecreated:5/2/2019|
|Created within a date range||datecreated:2/1/2019..5/3/2019|
|Created before a specific date||datecreated:<2/1/2019|
|Created after a specific date||datecreated:>2/1/2019|
|Created prior to the current year||datecreated:a long time ago|
|Created within the current year||datecreated:this year|
|Created within the current month||datecreated:this month|
|Created within the current week||datecreated:this week|
To find modified files within a date range use datemodified: instead of the datecreator: operator. To find files accessed in a date range, use
“Earlier” search query
Other than this you can even use some vague operators such as:
datemodified:Earlier this month datemodified:Earlier this year
When I used the Earlier this month query, it listed out files from the 1st week of the month (and today is 15th of the month). The search results of the
"Earlier this" search query is relative to the current day, week, or the month. This means that running the same query at the end of the month may fetch files created or modified till the mid-month or the 3rd week.
You can combine or mix and match as many operators as you can, to refine the search results based on file type, name, size, attributes, etc., per your requirement.
For more information about the Advanced Query Syntax, read post Advanced Query Syntax at the Microsoft Docs website.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.