locked
How to parameterized query......... RRS feed

  • Question

  • hello.....

    I don't know how to parameterized MDX query.....

    can anyone give me solution please.....

     

     

    WITH

    set set1 as

    (    

          {[date].[newdate].[2008-07-05 00:00:00.000]:[date].[newdate].[2008-07-25 00:00:00.000]}     

          ,{[date].[arrivedate].[2008-01-01 00:00:00.000] : [date].[arrivedate].[2008-12-27 00:00:00.000]}

          ,{[date].[departdate].[2008-01-01 00:00:00.000] : [date].[departdate].[2008-12-30 00:00:00.000]}

          ,[status].[businessid].[businessid]

          ,[status].[p pickroom]

          ,[status].[pickroom]

          ,[status].[p statusid]

          ,[status].[statusid]

    )

    MEMBER [Measures].z AS  SUM

    (

          set1,CASE

            WHEN ([Measures].[p statusid] =3  

                       and [Measures].[statusid] = 3

                       and [MEASUREs].[p pickroom] = 0

                       and [MEASUREs].[pickroom] = 0 )

                                 

                                  THEN ([Measures].[blockroom] -[Measures].[p blockroom])

                                 

          WHEN ([Measures].[p statusid] =3

                       and [Measures].[statusid] = 3

                       and [MEASUREs].[p pickroom] = 1

                       and [MEASUREs].[pickroom] = 1 )

                       

                                  THEN ([Measures].[pickroom]-[Measures].[p pickroom])

                                  end

    )

     

    select [MEASUREs].[z] on 0 from [demo]........

     

     

    this is my query.......


    Friday, April 1, 2011 9:50 AM

Answers

  • Looks like u want to make the date part parameterized

    In this case you can use, STRTOMEMBER("[date].[newdate].["+Cstr(Now())+" 00:00:00.000]") or

    STRTOMEMBER("[date].[newdate].["+Cstr(@Paramter)+" 00:00:00.000]")

    The @Parameter will be defined in the SSRS report/


    vinu
    • Proposed as answer by Vinuthan Friday, April 8, 2011 1:54 AM
    • Marked as answer by Jerry Nee Sunday, April 10, 2011 2:07 AM
    Friday, April 1, 2011 11:45 AM

All replies