I have a ton of email in my Gmail archive, and sometimes need to dig through older email. Problem is, if I do a search, it shows me all the most recent matches first when what I really want to do is, say, search for messages more than a year old, or 12-18 months ago or similar. Is there any way to do a more sophisticated search than just by keyword?
I’m a big fan of Google’s Gmail service, and have found that experimentation is a great thing in terms of its search, just as poking around and trying different things in Google’s main search system can real all sorts of useful capabilities, including the ability to convert measurement and weight units and the ability to solve even fairly complicated formulas.
In Gmail, as with many Google properties, the real secret is to pay attention to the small print (does that sound like something your Dad might have told you when you were younger? 🙂
For example, when you’re in Gmail, here’s what you see in the search area:
Look closely. See the link “Show search options”? Click it:
That’s pretty interesting, isn’t it? 🙂
Now let’s poke around a bit. If I do a search for “contract” on email that’s between one and two years old (which is done, rather awkwardly, as being within six months of 18 months ago), the resultant URL is:
So we can see that Gmail uses a different sort of URL notation for advanced searches with “#advanced-search/subset=all”. The keyword is in the “has=” value, and then there’s a “date=” and a “within=”. The question is, can we use those as predicates directly in a search?
I’ll try it, searching for “contract within:6m date:01/01/2008”. The result? Zero.
Ah, well, okay, so that doesn’t work. But what does?
Turns out that with a big of digging, Google has an advanced search help page that details the following long list of predicates:
operator | definition | example |
---|---|---|
from: | message sender | “from:dave” = all mail with ‘dave’ in sender field |
to: | message recipient | “to:sydney” = all mail with ‘sydney’ in the destination field (including mail not from you) |
subject: | message subject | “subject:dinner” = all mail that has ‘dinner’ in the subject |
after: | messages sent after a certain date | “after:2009/03/01” = all mail sent after March 1, 2009 (date format must always be YYYY/MM/DD) |
before: | messages sent before a certain date | “before:2009/01/01” = all mail sent before January 1, 2009. |
There are many more entries (see the original Google article) but these are the key ones that most power users are going to focus upon. This also gives us the tools we need to do the search we really want to do:
“contract before:2008/06/01 after:2007/06/01”
That, finally, gives us all email that contains the word “contract” and was sent or received between June 1, 2007 and June 1, 2008.
All messages more than a year old? Just use “before:” and follow it with the previous year and current month and day. As I write this, it’d be “2008/06/21”.
Sometimes experimentation fails, as we saw with my first stab, but exploring the help menus and everything else definitely reveals that the Gmail search system has quite a bit more power than is immediately obvious, and quite a bit more power than even you get with the ‘advanced search’ pane.
I would like to retrieve all emails sent by Tesla Motors since 2016.
Thanks,
Arvind
im looking for email i sent in 2014…thru gmail..maybe yahoo.with pic attachments.of auto accident……how do i find them or can i find them?????
try specifying “before:12/31/2014 after:1/1/2014 auto” to see if that works for you? or change ‘auto’ to ‘yahoo’ or both words?
When I do a search for old emails it only goes back to 2014 or 2015 and doen;t show me more current emails. Why?
How do I select range of data using term field of google vault. I know how to do it through date fields. if someone can help me how to use term field to select range of data would be .great.
Hi Dave,
Any chance you would like to post an update?
I found a way to follow the instructions even though some window appearances are different, the steps are still the same.
However the outcome was not the same, the steps did not yield the same result.
I am wondering if I have some kind of setting that needs to be changed on my gmail.
Today is 5/12/2013, mother’s day. I want to view emails
from:(one.contact@internet.mail.address.com,) after:2012/5/01 before:2013/5/12
yet I only receive a list of emails going back to 12/19/2012…what gives?
Any thoughts? Advice? Answers? I would greatly appreciate finding an very important email.
Thank you Dave.
Hi Dave, is there a way to do this for ymail (yahoo mail)?
The before: and after: search tags would appear to only apply to the date the mail was received in GMail… not when it was sent…. 🙁