title: Convert "YYYYMMDD" format string to date in MDX?
body: <p>I have some issue with applying date related functions on the &quot;YYYYMMDD&quot; format string in MDX. For example, if I have this query below:</p>
  <pre><code>with 
      member foo as WEEKDay(&quot;2013-03-21&quot;)
  select
      foo on 0
  from 
      [Some Cube]
  </code></pre>
  <p>It will correctly output &quot;5&quot; for foo in SSMS. But if I change the second line to:</p>
  <pre><code>   member foo as WEEKDay(&quot;20130321&quot;)
  </code></pre>
  <p>Unfortunately, it will throw &quot;type mismatch&quot; error.</p>
  <p>So what I want to do is that converting the string to some recognizable date format and then applying the functions on it. Any ideas for the easiest way, e.g. using existing functions?</p>
  <p><strong>Please note</strong> that the string is actually inputted from members in any cube where the MDX is running on. So the string format could have been recognizable, e.g. &quot;YYYY-MM-DD&quot;. So hard coded string converting algorithm may not be ok.</p>