Re: Error whilst processing ORDER BY clause

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Stuart M (anonymous_at_discussions.microsoft.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 02:36:06 -0800


The property "urn:schemas:httpmail:read" is of type boolean, so I have tried to cast it to a string in the ORDER BY using CAST("urn:schemas:httpmail:read" AS "string"), the statement then executes but the results are incorrectly ordered. (I also tried casting to int and boolean with no luck). If you add this value to the property list at the top of the SELECT statement the reason comes out, the cast always returns NULL. So its not possible to cast a boolean value in this way.
I did find another post on the same issue in MS SQL server 2000, this suggested you could use a workaround invloving the CASE clause, ie. SELECT CASE WHEN "urn:schemas:httpmail:read" THEN 1 ELSE 0 END AS <VarName>, ..........., ORDER BY <VarName>, but it appears this is not supported by the Exchange provider. So I'm still stuck on this issue.
Stuart