Summary:


An Issue may arise while running reports with Sorting Options set to "By Translation" or "By Caption", it can show:  An error occurred while running the report.SQLError. This is a known bug escalated for fix.

 

Cause:


The issue is due to sorting options when selected changing the query structure adding aliasName to it which is not identified and throwing error.

The SQL Server Log, shows the query that produces the error:

sep 14 2016 11:04:32.739 5108 2284 1 fselectsql,time,sql,errormsg 16 SELECT DISTINCT oppo_stage, COALESCE(oppo_stage_OrderByCapt.Capt_US, oppo_stage) FROM vreportopportunity LEFT OUTER JOIN Custom_Captions oppo_stage_OrderByCapt ON oppo_stage_OrderByCapt.Capt_Family = 'oppo_stage' AND oppo_stage_OrderByCapt.Capt_Code = aliasName.oppo_stage WHERE (( COALESCE(oppo_status, '') = N'In Progress' ) ) ORDER BY COALESCE(oppo_stage_OrderByCapt.Capt_US, oppo_stage), oppo_stage The multi-part identifier "aliasName.oppo_stage" could not be bound


Analizing the query on the SQL server console it seems to that the problem is because aliasName doesn’t exists:

SELECT DISTINCT COALESCE(oppo_stage_OrderByCapt.Capt_US, oppo_stage)
FROM vreportopportunity
LEFT OUTER JOIN Custom_Captions oppo_stage_OrderByCapt ON oppo_stage_OrderByCapt.Capt_Family = 'oppo_stage'
AND oppo_stage_OrderByCapt.Capt_Code = aliasName.oppo_stage
WHERE (( COALESCE(oppo_status, '') = N'In Progress' ) )
ORDER BY COALESCE(oppo_stage_OrderByCapt.Capt_US, oppo_stage)

Workaround:

Edit the report and try changing Sort Options to: 'By Caption' or Leave it blank.