Dear All, I am using the following query to get the messages from the public folder. The query works fine without the order by clause and even with \"DAV:creationdate\" in the order by clause but with the \"urn:schemas:httpmail:subject\" it is not working. and returns {"The remote server returned an error: (400) Bad Request." } Please help me out in this regard? "<?xml version='1.0' ?>" + "<a:searchrequest xmlns:a='DAV:'><a:sql>" + " SELECT \"DAV:href\",\"urn:schemas:httpmail:datereceived\",\"urn:schemas:httpmail:subject\",\"DAV:creationdate\",\"DAV:id\"" + " FROM scope('shallow traversal of \"" + Folder+ "\"')" + " WHERE \"DAV:isfolder\"=False AND \"DAV:iscollection\"=False ORDER BY \"urn:schemas:httpmail:subject\" "+ " </a:sql></a:searchrequest>" Thanks, Faraz Qureshi
Though it may surprise you, you can't order by "urn:schemas:httpmail:subject" as it is calculated. Try sorting with "urn:schemas:httpmail:normalizedsubject". Regards, - Karim wrote in message news:1144678199.336215.101260@t31g2000cwb.googlegroups.com... > Dear All, > > I am using the following query to get the messages from the public > folder. The query works fine without the order by clause and even with > \"DAV:creationdate\" in the order by clause but with the > \"urn:schemas:httpmail:subject\" it is not working. and returns {"The > remote server returned an error: (400) Bad Request." } > Please help me out in this regard? > > "<?xml version='1.0' ?>" + > "<a:searchrequest xmlns:a='DAV:'><a:sql>" + > " SELECT > \"DAV:href\",\"urn:schemas:httpmail:datereceived\",\"urn:schemas:httpmail:subject\",\"DAV:creationdate\",\"DAV:id\"" > + > " FROM scope('shallow traversal of \"" + Folder+ "\"')" + > " WHERE \"DAV:isfolder\"=False AND \"DAV:iscollection\"=False ORDER > BY \"urn:schemas:httpmail:subject\" "+ > " </a:sql></a:searchrequest>" > > > Thanks, > Faraz Qureshi >