dbTalk Databases Forums  

MDX DATE PARAMETER

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


Discuss MDX DATE PARAMETER in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Chen
 
Posts: n/a

Default MDX DATE PARAMETER - 12-05-2003 , 11:34 AM






MDX DATE PARAMETER:

In TSQL WE CAN write:

SELECT * FROM Employees
WHERE Hiredate > ='01/01/1988'
AND Hiredate < ='12/31/1998'


How can I do in MDX: I want to put the date as a
parameter in SQL Server Reporting Service.

Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: MDX DATE PARAMETER - 12-06-2003 , 09:28 PM






Reposting the answer from microsoft.beta.reporting.services.general. Please
let me know if this didn't work for you.

The answer really depends on how you designed your cube.
I assume, that you have standard Time dimension - then your query could look
something like

WITH MEMBER Measures.PeriodSales AS ' Aggregate( Time.FromDate :
Time.ToDate, Sales ) '
SELECT {Measures.PeriodSales} ON COLUMNS, something else ON ROWS
FROM cube

To make FromDate and ToDate parameters - you will have to do string
concatenation of the query, i.e.

"WITH MEMBER Measures.PeriodSales AS ' Aggregate( Time.[" +
Parameters!FromDate.Value + "] : Time[" + Parameters!ToDate.Value + "],
Sales ) ' " +
"SELECT {Measures.PeriodSales} ON COLUMNS, something else ON ROWS " +
"FROM cube"


--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================
"John Chen" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
MDX DATE PARAMETER:

In TSQL WE CAN write:

SELECT * FROM Employees
WHERE Hiredate > ='01/01/1988'
AND Hiredate < ='12/31/1998'


How can I do in MDX: I want to put the date as a
parameter in SQL Server Reporting Service.



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.