2

Please I need your help 4 days i'm searching about solution for this error i have this code :

SELECT NON EMPTY { [Measures].[T POND], [Measures].[FACT TABLE Count],
 [Measures].[disponibilite], [Measures].[POND], [Measures].[T] } 

 ON COLUMNS, NON EMPTY { ([DIM AXE GEO 2].[VILLLE].[VILLLE].ALLMEMBERS ) } 
 DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM (
     SELECT ( 
     STRTOMEMBER("[dim_date_Debut].[PK_Date].&["+ Format(CDate(Parameters!FromDimDateDebutPKDate.Value),
     "yyyy-MM-dd")+"T00:00:00]") : STRTOMEMBER("[dim_date_fin].[PK_Date_fin].&
     ["+Format(CDate(Parameters!ToDimDateDebutPKDate.Value),"yyyy-MM-dd")+"T00:00:00]")) 
 ON  COLUMNS FROM [CubeDispo])


CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

This is the error when i deploy

query execution failed for dataset 'dataset1' query(4,93) Parser: the syntax for '.' is incorrect

Thank you in advance

Imane Fateh
  • 2,418
  • 3
  • 19
  • 23

2 Answers2

1

Is something wrong with your parameter replacement in SSRS? It looks like maybe they are not being passed down? When I change:

STRTOMEMBER("[dim_date_Debut].[PK_Date].&["+ Format(CDate(Parameters!FromDimDateDebutPKDate.Value),
     "yyyy-MM-dd")+"T00:00:00]") 

To

STRTOMEMBER("[dim_date_Debut].[PK_Date].&[2010-01-01T00:00:00]")

The syntax is fine.

Firstly, run SQL Server Profiler, do an Analysis Services trace and capture the MDX that is being sent to SSAS from SSRS.

If the "Parameters!ToDimDateDebutPKDate.Value" is still in the MDX, then check how your parameters are being assigned to the dataset.

Meff
  • 5,889
  • 27
  • 36
  • As i mentioned in my answer above, looks like RS is not evaluating your expression because the query is not prefixed with = operator. In that case you would see the whole string passed as it is to the back end SSAS. – Ron5504 Jul 31 '13 at 17:26
  • i started to be crazy i tried severales days without solution :( – user2638280 Jul 31 '13 at 22:16
1

I see you are doing string concatenation to form your query. Make sure you use = operation to tell RS that its not a static query but an expression.

For example if i use this as a query in query designer, i would get an error.

"Select * from table where col =" & Parameters!FromDimDateDebutPKDate.Value

while the same thing with = operator before it becomes an expression which RS would evaluate before sending it to SQL

="Select * from table where col =" & Parameters!FromDimDateDebutPKDate.Value

Ron5504
  • 2,676
  • 2
  • 13
  • 15