Error Date Type
Hi! Running a SSRS report, displays the message: The string '1 / 1 / 2011 'can not be converted to date type The field is of type DateTime. Within the dataset parameters in "FX" left with the parameter value: = "[Time]. [Date Time ].&["& Parameters!DateStart.Value &"] " My MDX query: STRTOMEMBER(@TEMPOTempoDataInicial, CONSTRAINED) : STRTOMEMBER(@TEMPOTempoDataFinal, CONSTRAINED) How to solve?
January 2nd, 2012 6:47am

Bruno, Please check what is unique member value for '1/1/2011'. Same value should be constructed & passed to STRToMember Function For example = "[Time]. [Date Time ].&[20110101] " You have to reformat your expression as below. Again this is dependent on your unique member name. So you have to change below expression accordingly. = "[Time]. [Date Time ].&["& CSTR(Year(Parameters!DateStart.Value))+CSTR(Month(Parameters!DateStart.Value).ToString("00"))+ CSTR(Day(Parameters!DateStart.Value).ToString("00")) &"] " For more information please refer Using a Date Parameter in SSRS with MDX Thanks, Sandip Shinde Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
January 2nd, 2012 7:04am

It worked for periods records. Now no records did not work. If I do a search between dates that do not return data, example: 01/01/2012 to 30/01/2012 Error in processing report. (rsProcessingAborted) Query execution failed for data set 'DataSet1'. (rsErrorExecutingCommand) Query (19, 55) The restrictions imposed by the CONSTRAINED flag in the function StrToMember were violated.
January 2nd, 2012 7:25am

Bruno, as my last posting on this thread , can you please confirm unqualified member name for your date? In SSAS cube your date 01/12/2012 can be treated as 20120112 OR 20120112. When the CONSTRAINED flag is used, the member name must be directly resolvable to a qualified or unqualified member name. This flag is used to reduce the risk of injection attacks via the specified string. If a string is provided that is not directly resolvable to a qualified or unqualified member name, the following error appears: "The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function were violated."Thanks, Sandip Shinde Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
January 2nd, 2012 7:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics