Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filtering and SQL

0 views
Skip to first unread message

news.microsoft.com

unread,
Feb 18, 2004, 5:27:53 AM2/18/04
to
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

Sue Mosher [MVP-Outlook]

unread,
Feb 18, 2004, 8:01:01 AM2/18/04
to
It's DASL, with specifics documented in the Exchange SDK --
http://msdn.microsoft.com/exchange. You cannot use functions like dateadd to
build a formula.

Best approach IMO is just to keep experimenting.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"news.microsoft.com" <g.w...@surrey.ac.uk> wrote in message
news:eTSKgng9...@TK2MSFTNGP09.phx.gbl...

0 new messages