Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   WHERE without using CASE (http://www.outlookbanter.com/add-ins-outlook/99369-where-without-using-case.html)

Mark B[_2_] January 22nd 10 09:09 PM

WHERE without using CASE
 
I'm trying to edit a Filter in Outlook and it has a sort of SQL syntax. The
only thing is I don't know if it accepts CASE statements -- it's giving a
'SQL parsing' error.

Is there another simple SQL way of doing this WHERE clause without using
case (e.g. using AND or OR)?:

WHERE (CASE WHEN (MyField1 IS NULL) THEN (MyField2) ELSE (MyField1))1













My Reference:

(CASE WHEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"
IS NULL) THEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField2")
ELSE
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"))1


Mark B[_2_] January 22nd 10 09:19 PM

WHERE without using CASE
 
Think I may have it:

WHERE

(MyField11 AND MyField2 IS NULL)

OR

((MyField2 IS NOT NULL) AND MyField21)



"Mark B" wrote in message
...
I'm trying to edit a Filter in Outlook and it has a sort of SQL syntax.
The only thing is I don't know if it accepts CASE statements -- it's
giving a 'SQL parsing' error.

Is there another simple SQL way of doing this WHERE clause without using
case (e.g. using AND or OR)?:

WHERE (CASE WHEN (MyField1 IS NULL) THEN (MyField2) ELSE (MyField1))1













My Reference:

(CASE WHEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"
IS NULL) THEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField2")
ELSE
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"))1



Tom Cooper January 22nd 10 09:21 PM

WHERE without using CASE
 
You could do

0WHERE MyField1 1 OR
(MyField1 Is Null AND MyField2 1)

Tom

"Mark B" wrote in message
...
I'm trying to edit a Filter in Outlook and it has a sort of SQL syntax.
The only thing is I don't know if it accepts CASE statements -- it's
giving a 'SQL parsing' error.

Is there another simple SQL way of doing this WHERE clause without using
case (e.g. using AND or OR)?:

WHERE (CASE WHEN (MyField1 IS NULL) THEN (MyField2) ELSE (MyField1))1













My Reference:

(CASE WHEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"
IS NULL) THEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField2")
ELSE
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"))1



Mark B[_2_] January 22nd 10 09:34 PM

WHERE without using CASE
 
Thanks.

"Tom Cooper" wrote in message
...
You could do

0WHERE MyField1 1 OR
(MyField1 Is Null AND MyField2 1)

Tom

"Mark B" wrote in message
...
I'm trying to edit a Filter in Outlook and it has a sort of SQL syntax.
The only thing is I don't know if it accepts CASE statements -- it's
giving a 'SQL parsing' error.

Is there another simple SQL way of doing this WHERE clause without using
case (e.g. using AND or OR)?:

WHERE (CASE WHEN (MyField1 IS NULL) THEN (MyField2) ELSE (MyField1))1













My Reference:

(CASE WHEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"
IS NULL) THEN
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField2")
ELSE
("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyField1"))1





All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com