"There was an error parsing the query. [Token line number = 2,Token line offset = 13,Token in error = 2011 ] Number: -2146233087"
Entry Type: Program Issue or Documentation Issue
Product: Sage ERP MAS Intelligence
Application: n/a
Version Reported: 4.40
Status:
This issue is being researched by Engineering.
Subject:
"There was an error parsing the query. [Token line number = 2,Token line offset = 13,Token in error = 2011 ] Number: -2146233087" when generating a report with a date type passthrough variable.
Steps to Duplicate:
In ABC company:
- Open Connector
- Expand the MAS 90 4.0 ODBC Driver / Sage MAS(Auto Connect)
- Right click Customer Sales 2-0(MAS) and select Add Expressions
- In the Select the Expression Type to Add, select the SQL Expression radial button and click OK
- When prompted for the SQL Expression name enter PTVDATEEXPRESSION and click OK
- In the Enter the SQL Text for the Expression, enter @EndDate@ + 7 and click OK
- Open Report Manager
- Create a report using the Customer Sales container
- In the Choose Column Fields, choose PTVDATEEXPRESSION and click OK
- Expand the Report
- Right click on the Parameters and select Add Parameters
- In the Choose Filter Fields, select EndDate and click OK
- Leave the Optional Default blank
- Generate the Report
- Enter the date 29 July 2011
- Note the error "There was an error parsing the query. [Token line number = 2,Token line offset = 13,Token in error = 2011 ] Number: -2146233087"
-
Note if report is run in SQL Debug, the Query will show that the date has two single quotes:
{d ''2011-07-29''} which should be {d '2011-07-29'}
Expected Behavior:
Error should not occur .
Possible Workaround:
1.Change the Data Type of the Report Date passthrough variable
2. Change the DateAge expression to the following: we are changing @REPORT_DATE@ to CAST('@REPORT_DATE@' AS DATETIME)
The expression should be something like :
CASE WHEN CAST('@REPORT_DATE@' AS DATETIME)+7 > AR_OpenInvoice.InvoiceDate THEN
AR_OpenInvoice.Balance
ELSE
0
END