Error "Conversion failed
Error "Conversion failed when converting the varchar value 'xxxx' to data type int" happens when displaying Picture type attribute form using ApplySimple in expression against SQL Server 2012 in MicroStrategy
The attribute form is in Picture type and defined with the following ApplySimple function with Int type column [ID_BARANG] as the input parameter against SQL Server 2012.
Solutions is to use Concat("Images/demo/s", [BARANG_ID_INT], ".png")
ApplySimple("'images/demo/'�&'.png'", [ID_BARANG])
However, when running reports with attribute to show the picture form in Web, error message happens in both Web and Developer.
Conversion failed when converting the varchar value 'images/demo/s' to data type int.
STEPS TO REPRODUCE:
SQL Server 2012 database should be used as the warehouse.
Create an attribute form as type Picture and us custom expression as below where column [ID_BARANG] is of type Int in the database.
- ApplySimple("'images/demo/'�&'.png'", [ID_BARANG])
- Create report with the attribute and show the Picture form.
- Run report in Web and Developer. Error message will occur.
CAUSE:
The syntax used in ApplySimple is incorrect for SQL Server 2012 database.
ACTION:
Use Concat function instead.
Concat("Images/demo/s", [BARANG_ID_INT], ".png")
NOTE: This is database specific issue. Using the same expression against Microsoft Access database would not result in any error.
Thank you for sharing wonderful information with us to get some idea about that content.
ReplyDeleteMicrostrategy Training
Microstrategy Online Training