Outlook 2003/2007 SQL Search Folders

Outlook Search Folders can have a SQL-like structure for filtering the contents. I wanted a search folder that would show me anything in any folder over X months old, since my office blocks the use of .pst or archive's, I needed a semi-automated way to clean things out of project folders and the like.

  1. Create the search folders and focus them on just the mail folders you want to search, don't worry about the filter so just chose a simple one.
  2. Outlook 2003 users will see the SQL tab when customizing the search folder, but it's hidden and annoying in 2007. Thanks to Andrew Delin for pointing us to how to see the SQL tab in the "customize this search folder" screen: basically customize your button bar and add View>Filter as a button. Then click on a search folder and click the Filter... button to see a SQL tab for entering this info.
  3. I wanted to search back six months, so this is my sql statement. the number is the seconds from today (60s*60m*24h*6m):
"DAV:getlastmodified" <= today(-15552000)

Another cool search folder filter based on conversations over at on20.net. More date examples at Andrew Delin's WebLog.