none
STRTOMEMBER Issue with SSRS Report

    Question

  • Team , Can some one Please advise on below ?

    This one seems to be working fine when pasted in SSMS MDX Pane .

    FROM  [<<Cube Name>>]
    WHERE 
    (
    	
    	
    	STRTOMEMBER("[Time].[Year - Quarter - Month - Day].[Year].&["+cstr( 2009 )+"-01-01T00:00:00]")
    
    )

    When i wanted to make the year parameter Dynamic  SSRS Report Designer Compalins  Parser :Inctorrect syntax near 'T00' , MY year Parameter is a drop down list with single select .

    FROM  [<<Cube Name>>]
    WHERE 
    (
    	
    	
    	STRTOMEMBER("[Time].[Year - Quarter - Month - Day].[Year].&["+cstr( @TimeYear )+"-01-01T00:00:00]")
    
    )

    Thanks in advance for your help !


    Rajkumar Yelugu

    Wednesday, July 24, 2013 2:22 PM

Answers

  • Hi Rajkumar ,

    I would use the quote option . Means, all the query will be covered with quotes :

    ="Select a,b "

    + " From Cube "

    + " where STRTOMEMBER(""[Time].[Year - Quarter - Month - Day].[Year].&[""+cstr( @TimeYear )+""-01-01T00:00:00]"" "

    The two quotes (SSRS) will be translated into one quote when running .

    The quote option for the expression will help you to trace the query much easier by using the profiler (will show the query with the values being extracted from the parameters) .

    Hope it helps :) 


    Regards, David .

    Thursday, July 25, 2013 10:09 AM

All replies

  • Obviously it is something related to the way SSRS is receiving the parameter value. Have you checked the data type for your parameter, it should be integer or numeric. You can also add a Label containing the value of the parameter just to confirm you are receiving the expected value.

    HTH.


    Please, mark this post as Answer if this helps you to solve your question/problem.
    Alan Koo | "Microsoft Business Intelligence and more..." http://www.alankoo.com

    Wednesday, July 24, 2013 11:17 PM
  • Hi Rajkumar ,

    I would use the quote option . Means, all the query will be covered with quotes :

    ="Select a,b "

    + " From Cube "

    + " where STRTOMEMBER(""[Time].[Year - Quarter - Month - Day].[Year].&[""+cstr( @TimeYear )+""-01-01T00:00:00]"" "

    The two quotes (SSRS) will be translated into one quote when running .

    The quote option for the expression will help you to trace the query much easier by using the profiler (will show the query with the values being extracted from the parameters) .

    Hope it helps :) 


    Regards, David .

    Thursday, July 25, 2013 10:09 AM
  • Thanks David and Alan , I'm going to test it and update here .

    Rajkumar Yelugu

    Friday, July 26, 2013 12:18 PM