Results 1 to 2 of 2

Thread: MDX selection between two dates

  1. #1
    Join Date
    May 2009
    Posts
    1

    MDX selection between two dates

    I need to write MDX query that select data between two dates.
    The problem is that the dates I get from the user are not necessarily exists in my date dimension.

    I tried implementing it by the following code, but it didn't work correctly.
    (The dates in the example : 2008-05, 2009-05 ,are the input dates given by the user, and they are not necessarily exists in the Dim Date table.)
    Here is my code:

    SELECT [Dim_Customer].Members ON COLUMNS,
    [Measures].[DPM] ON ROWS
    FROM [Cube]
    WHERE [Dim Date].[Calendar].[Year Month].[2008-05]:[Dim Date].[Calendar].[Year Month].[2009-05]

    Thanks in advance.
    Tovi

  2. #2
    Join Date
    Jun 2004
    Location
    Atlanta and Manhattan
    Posts
    607

    Couple of Questions ...

    Are you saying that 1) the Date dim table is missing dates (that is, does not include all dates), or are you saying that your query is attempting to select data at a different date granularity than exists within the Date dim table?

    Thanks.

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •