2009-11-20 242 views
0

我试图访问和从Exchange Server 2003中提取邮件。我需要按日期来获取它们,但我有问题。WebDAV日期范围查询

下面的代码lsQuery = "<?xml version=\"1.0\"?>" + "<D:searchrequest xmlns:D = \"DAV:\" xmlns:m=\"urn:schemas:httpmail:\">" + "<D:sql>SELECT \"urn:schemas:httpmail:hasattachment\", \"DAV:displayname\", " + "\"urn:schemas:httpmail:from\", \"urn:schemas:httpmail:subject\", " + "\"urn:schemas:httpmail:htmldescription\" FROM \"" + lsRootUri + "\" WHERE \"DAV:ishidden\" = false " + "AND \"DAV:isfolder\" = false " + "AND \"urn:schemas:httpmail:hasattachment\" = true " + "AND \"urn:schemas:httpmail:read\" = false " + "AND \"urn:schemas:httpmail:date \" \"&gt;=\" CAST(\"2009/11/17\" as 'dateTime') " + "AND \"urn:schemas:httpmail:date \" \"&lt;=\" CAST(\"2009/11/19\" as 'dateTime') " + "</D:sql></D:searchrequest>";

回答