• Subject: Re: Outlook Restrict on SentOn (using Between)
  • Author: Sue Mosher [MVP]
  • Date: 28 Sep 2009
  • References: 1
Only your first statement is workable. Between is not an available operator,
and SentOn includes the time element, not just a date, so you're unlikely to
find an exact match. See http://www.outlookcode.com/article.aspx?id=30. I
recommend that you use a separate statement to build the query string so you
can examine it and, if you continue to have issues with this, post a
specific example in this thread so we can see how you're formatting the
dteStart and dteEnd values.
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"McKilty" <bluesbrthr@gmail.com> wrote in message
news:90bca1e3-225e-49ef-b6ec-d62bf8b62fd9@e18g2000vbe.googlegroups.com...
> Hello all,
>
> I am trying to figure to the proper syntax for using Restrict on the
> SentOn field. I need to restrict between two dates, but so far
> nothing is filtering to the exact date range I'm looking for. I have
> tried:
>
> Set mItemCollection = mItemCollection.Restrict("[SentOn] > '" &
> dteStart & "' AND [SentOn] < '" & dteEnd & "'")
> Set mItemCollection = mItemCollection.Restrict("[SentOn] = '" &
> dteStart & "'")
> Set mItemCollection = mItemCollection.Restrict("[SentOn] Between '" &
> dteStart & "' AND '" & dteEnd & "'")
>
> Thanks for the help.
28 Sep 2009Outlook Restrict on SentOn (using Between).McKilty
28 Sep 2009\ Re: Outlook Restrict on SentOn (using Between).Sue Mosher [MVP]
28 Sep 2009   \ Re: Outlook Restrict on SentOn (using Between).McKilty
Contact Us
All times are in (US) Eastern Daylight Time (GMT -4:00)