dbTalk Databases Forums  

How to do a OR in the where clause

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How to do a OR in the where clause in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
karenmiddleol@yahoo.com
 
Posts: n/a

Default How to do a OR in the where clause - 05-18-2005 , 06:44 AM






I have two named sets one called [Customers].[ThoseIWant] and the other
called [Gender].[GendersIWant].

Now I want to select in the where clause either customers I want or the
Genders I want as follows:


with member [Customers].[ThoseIWant] AS
'SUM(except({[Customers].[coun*try].[USA].children}, {[Customers].[All

Customers].[USA].[CA]}))'


member [Gender].[GendersIWant] AS
'SUM(except({[Gender].[Gender]*.members},{[Gender].[All Gender].[M]}))



Select {[measures].members} on columns ,
{[Product].[Product Category].members} on rows
Quote:
From [Sales]
Where ([Customers].[ThoseIWant] or [Gender].[GendersIWant])



Please let me know how I can perform a OR clause in the where clause.


Thanks
Karen



Reply With Quote
  #2  
Old   
Vini
 
Posts: n/a

Default Re: How to do a OR in the where clause - 05-19-2005 , 07:06 AM







<karenmiddleol (AT) yahoo (DOT) com> wrote

I have two named sets one called [Customers].[ThoseIWant] and the other
called [Gender].[GendersIWant].

Quote:
snip
Select {[measures].members} on columns ,
{[Product].[Product Category].members} on rows
Quote:
From [Sales]
Where ([Customers].[ThoseIWant] or [Gender].[GendersIWant])

Quote:
snip

It's easy:
Where ([Customers].[ThoseIWant] , [Gender].[GendersIWant])




Reply With Quote
  #3  
Old   
karenmiddleol@yahoo.com
 
Posts: n/a

Default Re: How to do a OR in the where clause - 05-19-2005 , 08:08 AM



Vini

If the syntax for a OR is what you specified. How would I do a AND like
the following

Select {[measures].members} on columns ,
{[Product].[Product Category].members} on rows
Quote:
From [Sales]
Where ([Customers].[ThoseIWant] AND [Gender].[GendersIWant])

Thanks
Karen



Reply With Quote
  #4  
Old   
MartinDS
 
Posts: n/a

Default Re: How to do a OR in the where clause - 05-19-2005 , 02:55 PM



Only replace the AND for a ,
Where espects a tuple.

Select {[measures].members} on columns ,
{[Product].[Product Category].members} on rows
Quote:
From [Sales]
Where ([Customers].[ThoseIWant] , [Gender].[GendersIWant])


"karenmiddleol (AT) yahoo (DOT) com" wrote:

Quote:
Vini

If the syntax for a OR is what you specified. How would I do a AND like
the following

Select {[measures].members} on columns ,
{[Product].[Product Category].members} on rows
From [Sales]
Where ([Customers].[ThoseIWant] AND [Gender].[GendersIWant])

Thanks
Karen



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.