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.
"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.