title: Filtering data in SSRS Report Builder by passing datetime parameters using DateTime Picker to MDX Query
body: <p>I'm a noob with MDX, but I've gotten SSRS to work with parameters with regular SQL queries and stored procedures.  I want to filter the cube with a start and an end date, because there is a lot of data in there and the report takes too long using filters.  In SSRS I am using the date time picker control to pick the dates.</p>
  
  <p>Here's my MDX Query from SSRS after I set up the parameter, using the query designer:</p>
  
  <pre><code> SELECT NON EMPTY { [Measures].[Detail Presentation Count], [Measures].[Duration], [Measures].[DurationSeconds] } ON COLUMNS, NON EMPTY { ([Cube View Detail Presentation Country Dimension].[Country Alpha2].[Country Alpha2].ALLMEMBERS * [Cube View Detail Presentation Country Dimension].[English Short Name].[English Short Name].ALLMEMBERS * [Presentation].[Name].[Name].ALLMEMBERS * [Presentation].[Revision].[Revision].ALLMEMBERS * [Presentation].[ID].[ID].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOMEMBER(@FromCubeViewDetailPresentationTimeDimensionCreated, CONSTRAINED) : STRTOMEMBER(@ToCubeViewDetailPresentationTimeDimensionCreated, CONSTRAINED) ) ON COLUMNS FROM [DetailPresentation]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
  </code></pre>
  
  <p>I've tried passing in various formats of the date value from the SSRS parameter, but none work, and the query will not run.  The dates are in this format:  2011-01-04 06:10:38.000000.</p>
  
  <p>What's the format of the date I need to pass, or do I need to build up more than this a date string for the MDX query to work?</p>