dbTalk Databases Forums  

Re: OLAP - Custom Date Ranges

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


Discuss Re: OLAP - Custom Date Ranges in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Chester
 
Posts: n/a

Default Re: OLAP - Custom Date Ranges - 03-05-2004 , 10:46 AM






You're question could mean one of two things. Here's how to query a range of
dates:

SELECT
{ Time.[2002] : Time.[2004] } on axis(0),
etc.

Or, to aggregate data for a range of dates:

WITH MEMBER Measures.X AS
' SUM({Time.[2002] : Time.[2004]}, MyMeasure) '
SELECT
etc.
WHERE (Measures.X)

public @ the domain below
www.tomchester.net


"PCK" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Could someone provide me with an MDX example of how to query a customized
date range. My long term goal is to be able to select a subset of data that
is contained within a certain period of time.
Quote:
For example in FoodMart how would I go about getting all sales for a
customer 'XYZ' from 3/6 through 3/17.

Thanks for the help.

Patrick



Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: OLAP - Custom Date Ranges - 03-05-2004 , 12:41 PM






SQL and MDX are very different, both syntactically and conceptually. In my
earlier post you have examples of how to query a range of dates, and how to
aggregate for a range of dates. Either or both may apply, but that depends
on what output you are trying to produce. Did those examples make sense?

public @ the domain below
www.tomchester.net


"PCK" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Lets say that we have a time member with levels of year, month, day.

I am trying to write a MDX query that would have similar logic to this SQL
statement.

SELECT *
FROM Sales
WHERE customerID = 1234
AND date between '2/17/04' and '3/3/04'



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.