A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

View filter on mail items sent in the last 30 days



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 11th 08, 04:04 PM posted to microsoft.public.outlook.program_vba
David
external usenet poster
 
Posts: 196
Default View filter on mail items sent in the last 30 days

While trying to create what I thought was a simple view filter to show mail
items sent in the last 30 days I've learned that Outlook doesn't accomodate
this via simple configuration. I tried doing an Advanced filter but I'm
still constrained by the same limitations (e.g. last 7 days, last month...).
I'm no wiz with SQL but it seems this is the only place where I can
accomplish what I'm after. I tried the expression below but it didn't pass
the SQL parsing:

"urn:schemas:httpmail:date" = today() - 30

How can I apply a filter that will show me all email sent in the past 30 days?
Ads
  #2  
Old July 11th 08, 04:42 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default View filter on mail items sent in the last 30 days

As you've already determined, you can't. The DASL syntax for view filters
doesn't support expression like today() - 30. The best you can do is filter
for items after a specific date and change that literal date value in the
filter every day.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"David" wrote:

While trying to create what I thought was a simple view filter to show mail
items sent in the last 30 days I've learned that Outlook doesn't accomodate
this via simple configuration. I tried doing an Advanced filter but I'm
still constrained by the same limitations (e.g. last 7 days, last month...).
I'm no wiz with SQL but it seems this is the only place where I can
accomplish what I'm after. I tried the expression below but it didn't pass
the SQL parsing:

"urn:schemas:httpmail:date" = today() - 30

How can I apply a filter that will show me all email sent in the past 30 days?

  #3  
Old July 17th 08, 05:56 PM posted to microsoft.public.outlook.program_vba
David
external usenet poster
 
Posts: 196
Default View filter on mail items sent in the last 30 days

Disappointing but it is what it is I guess. Any idea why the functionality
is so limited? When I hear SQL I think robust query language. It doesn't
seem very robust if it can't filter on a variable number of days, and
updating a specific date filter is less than ideal as I'm working for Outlook
in order to get it to work for me.

With a Sent Items folder that grows every day it would be nice to be less
taxing on the Exchange server and return only a current subset of mail items
instead of the entire folder which is currently in excess of 11k. Yikes!

Thanks for you help.

"Sue Mosher [MVP-Outlook]" wrote:

As you've already determined, you can't. The DASL syntax for view filters
doesn't support expression like today() - 30. The best you can do is filter
for items after a specific date and change that literal date value in the
filter every day.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"David" wrote:

While trying to create what I thought was a simple view filter to show mail
items sent in the last 30 days I've learned that Outlook doesn't accomodate
this via simple configuration. I tried doing an Advanced filter but I'm
still constrained by the same limitations (e.g. last 7 days, last month...).
I'm no wiz with SQL but it seems this is the only place where I can
accomplish what I'm after. I tried the expression below but it didn't pass
the SQL parsing:

"urn:schemas:httpmail:date" = today() - 30

How can I apply a filter that will show me all email sent in the past 30 days?

  #4  
Old December 19th 08, 09:37 AM posted to microsoft.public.outlook.program_vba
Simon
external usenet poster
 
Posts: 40
Default View filter on mail items sent in the last 30 days

Dear David,
you may try this way:
"urn:schemas:httpmail:date" & " = '" & Date.Today.Subtract(New TimeSpan(30,
0, 0, 0)) & "'"

it works on my app.
  #5  
Old July 20th 11, 09:54 PM
sbwill sbwill is offline
Junior Member
 
First recorded activity at Outlookbanter: Jul 2011
Location: Indianapolis, IN
Posts: 1
Default

David:

I, too, have spent significant time searching the web and experimenting to find an answer to this very question. All answers I found are vague, don't work, or simply say you can't do it. Happily, I stumbled onto a solution that is amazingly simple. I found it in a excerpt from the book "Sams Teach Yourself Microsoft Office Outlook 2003 in 24 Hours" by Diane Poremsky (Reference: See Figure 3.13 http://www.informit.com/store/produc...sbn=0672325543 ). I am using Outlook 2007 so I'm guessing it works for Outlook 2010 as well.

Here's what you do. The ***'ed step is the 'secret' step:

1. Create a Custom View
2. Edit that view and click the "Filter..." button
3. Click the "Advanced" tab
4. Click the "Field" drop-down button and select "Received"
5. Click the "Condition" drop-down and select "on or after"
***6. Click in the "Value" field and type "30 days ago" ('30' can be any integer)
7. Click "Add to List", "OK", "OK"

You will notice that this solution does not use SQL. I checked the SQL tab after following these steps and found that the correct date is magically hard coded into the expression. Thus, this still doesn't answer how to write a general SQL statement. However, it does the job.

Hope this helps!

P.S. This is my first post. Any feedback would be appreciated.

---
Quote:
Originally Posted by David View Post
While trying to create what I thought was a simple view filter to show mail
items sent in the last 30 days I've learned that Outlook doesn't accomodate
this via simple configuration. I tried doing an Advanced filter but I'm
still constrained by the same limitations (e.g. last 7 days, last month...).
I'm no wiz with SQL but it seems this is the only place where I can
accomplish what I'm after. I tried the expression below but it didn't pass
the SQL parsing:

"urn:schemas:httpmail:date" = today() - 30

How can I apply a filter that will show me all email sent in the past 30 days?
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter on last modified - X days bsharp Outlook - Using Contacts 0 December 4th 07 03:49 PM
how to retain 10 days items in Outlook 2003 deleted items folder? Balthazar Outlook - Installation 2 June 7th 06 05:05 PM
Auto Empty Deleted Items on Exit OR after X days or X Items accumulated? JDJ Outlook - General Queries 2 May 30th 06 11:48 PM
can I view all calendar items ticked private on a filter? minidriverpip Outlook - Calandaring 2 April 19th 06 11:39 PM
"There are no items to show in this view" in Taskpad. No filter. Cant reset Current view [email protected] Outlook - Calandaring 0 February 3rd 06 07:36 PM


All times are GMT +1. The time now is 10:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.