Filtering and SQL

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi,

Does anyone know of a resource which explains the syntax for SQL in the
filtering options in Outlook 2003 (View/Arrange By/Custom/Filter/SQL).
What I need to do is to get all email for the last year. Looking at the SQL
for other filters e.g. 'in the last 7 days' shows the SQL as :

%last7days("urn:schemas:httpmail:datereceived")%

I guess the last7days is a macro or something similar. Using the 'on or
before' would not be of any use as tusers would have to change the date
daily. Looking at the SQL for 'on or before' shows :

"urn:schemas:httpmail:date" >= '01/01/2004 00:00'

I would have guessed that to get those in the last year would be something
like:

"urn:schemas:httpmail:date" >= dateadd("d",-365,Now())

This doesn't work, I get a Error parsing your SQL text.

It appears that Now() is not recognised

Any help would be appreciated.

Gareth
 
Back
Top