Anagha Pirangute
Anagha Pirangute

Reputation: 1

Query Preparation Failed error for SSRS Parameter while using Query editor to modify MDX query

I am receiving following error while I am trying to edit SSRS Parameter using Query window.

Query Preparation Failed

An MDX expression was expected. An empty expression was specified. (Microsoft SQL Server 2012 Analysis Services)

My MDX query is as follows.

WITH 
MEMBER [Measures].[ParameterCaption] AS [Product].[Category].CURRENTMEMBER.MEMBER_CAPTION 

MEMBER [Measures].[ParameterValue] AS [Product].[Category].CURRENTMEMBER.UNIQUENAME 

MEMBER [Measures].[ParameterLevel] AS [Product].[Category].CURRENTMEMBER.LEVEL.ORDINAL 

SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , 
        [Product].[Category].ALLMEMBERS ON ROWS 

FROM ( SELECT ( STRTOMEMBER(@FromDateDate, CONSTRAINED) : STRTOMEMBER(@ToDateDate, CONSTRAINED) ) ON COLUMNS FROM [Adventure Works])

Thanks.

Upvotes: 0

Views: 1348

Answers (1)

Nighty_
Nighty_

Reputation: 545

The syntax looks fine to me so I am guessing there is some problems with your parameters, @FromDateDate and @ToDateDate. Have you given them a valid default value? Have you tried to remove the CONSTRAINED flag and see if that makes any difference?

Upvotes: 0

Related Questions