Restrictions on Date queries with WebDAV SQL for Exchange

March 18th, 2008

Turns out that you can’t query Exchange appointments for arbitrary date ranges.  According to Patrick at Microsoft (appropriate since it’s St. Patrick’s day), you are limited to querying to a 2 year range if you are searching for on both start and end date. For example, the below query is not legal:

SELECT
  "DAV:contentclass", "urn:schemas:calendar:dtstart",
  "urn:schemas:calendar:dtend",
  "http://schemas.microsoft.com/mapi/subject"
FROM
  "https://mail.example.com/exchange/somemailbox/Calendar"
WHERE
  "DAV:contentclass" = 'urn:content-classes:appointment'
  AND
  "urn:schemas:calendar:dtend" >=  CAST(\"2008-03-18T20:03:21.312Z\" as 'dateTime')
  AND
  "urn:schemas:calendar:dtend" <=  CAST(\"2028-03-18T20:03:21.312Z\" as 'dateTime') "

This doesn’t mean that queries can’t return more than two years worth of results, you just can used date ranges of more than two years. The resulting error is a (422) Unprocessable Entity. Other causes for this error are attempting to search on unsearchable fields.

Entry Filed under: .NET

2 Comments Add your own

  • 1. Software Warlock » &hellip  |  August 26th, 2008 at 11:45 pm

    [...] an more instances. To avoid this problem, Microsoft implemented a system where you can only query a bounded date range of up to 2 years. Once you have queried for a specific date range and the results have been cached, open-ended range [...]

  • 2. Warlock  |  August 26th, 2008 at 11:47 pm

    Also see my post about additional restrictions on WebDAV/Exchange.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

March 2008
M T W T F S S
« Jan   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts