WebDAV Query on Date Field
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
WebDAV Query on Date Field

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
dln
Guest





Posted: Tue Oct 18, 2005 4:58 pm    Post subject: WebDAV Query on Date Field Reply with quote

I'm having a problem querying a Public Folder using WebDAV. The PF stores
email items and all I want to do is to filter on items sent after a specific
date. I've followed the Microsoft recommendations for formatting the input
date at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_exch2k_search_tasks.asp
but I always get a 400 error (bad request). My request looks like...

<?xml version='1.0'?>
<D:searchrequest xmlns:D="DAV:">
<D:sql>
SELECT
"urn:schemas:httpmail:date",
"urn:schemas:httpmail:from",
"urn:schemas:httpmail:textdescription",
"urn:schemas:mailheader:subject"
FROM
"https://<path to public folder>/"
WHERE
"urn:schemas:httpmail:datereceived" < CAST("2005-10-18T00:00:00Z" as
'dateTime')
</D:sql>
</D:searchrequest>"

I've been monkeying with the date value in the WHERE clause and have tried
things like
"urn:schemas:httpmail:datereceived" < '10/18/2005'
"urn:schemas:httpmail:datereceived" < '10/18/2005 00:00:00'
"urn:schemas:httpmail:datereceived" < '2005-10-18T00:00:00Z'

but they all fail. I can query non-date fields without any problems. Can
anybody point me in the right direction?

Thanks,

dln

Back to top
dln
Guest





Posted: Tue Oct 18, 2005 11:47 pm    Post subject: Re: WebDAV Query on Date Field Reply with quote

Yep, that was the problem. Thanks a bunch!

dln.

"Michael" <michael@discussions.microsoft.com> wrote in message
news:eLtvB2A1FHA.1740@TK2MSFTNGP09.phx.gbl...
Quote:
You must use ">=" instead of ">" and "<=" instead of "<" in line
like

"urn:schemas:httpmail:datereceived" < CAST("2005-10-18T00:00:00Z" as

Michael
-------------------------------
If you need WebDAV API for Exchange server,
use our component WebDAV .NET for Exchange.
Check out http://www.independentsoft.com


"dln" <dnadon_nospm@hotmail.com> wrote in message
news:OQ07PHA1FHA.2752@TK2MSFTNGP12.phx.gbl...
I'm having a problem querying a Public Folder using WebDAV. The PF
stores
email items and all I want to do is to filter on items sent after a
specific
date. I've followed the Microsoft recommendations for formatting the
input
date at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_exch2k_search_tasks.asp
but I always get a 400 error (bad request). My request looks like...

?xml version='1.0'?
D:searchrequest xmlns:D="DAV:"
D:sql
SELECT
"urn:schemas:httpmail:date",
"urn:schemas:httpmail:from",
"urn:schemas:httpmail:textdescription",
"urn:schemas:mailheader:subject"
FROM
"https://<path to public folder>/"
WHERE
"urn:schemas:httpmail:datereceived" < CAST("2005-10-18T00:00:00Z"
as
'dateTime')
/D:sql
/D:searchrequest>"

I've been monkeying with the date value in the WHERE clause and have
tried
things like
"urn:schemas:httpmail:datereceived" < '10/18/2005'
"urn:schemas:httpmail:datereceived" < '10/18/2005 00:00:00'
"urn:schemas:httpmail:datereceived" < '2005-10-18T00:00:00Z'

but they all fail. I can query non-date fields without any problems.
Can
anybody point me in the right direction?

Thanks,

dln

Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
New Topics Powered by phpBB