Thursday 15 September 2011

Error when Suming values from CRM2011 - String not Dec

If you try to sum a value that you’ve queries through FetchXML from CRM 2011 then you need to make sure you choose the FieldNameValue.Value and not the FieldName.Value, the first is the actual value stored as a decimal/integer etc. and the second is simply stored as a string. If you try to sum a string you will see an error similar to this:

Error:
Warning  1 [rsRuntimeErrorInExpression] The Value expression for the textrun ‘extendedamountValue8.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "£‎1,614.13" to type 'Decimal' is not valid.      C:\SSRS Reports\Sales Pipeline.rdl           

Correct Answer for the Purposes of Totaling:
=sum(Fields!new_weightedestsalesValue.Value)

Wrong, unless you simply want to display the value as a string.:
=sum(Fields!new_weightedestsales.Value)

             

No comments:

Post a Comment

ADFS Timeout on Server 2012 for CRM 2011

This follows on from this Microsoft Guide http://social.technet.microsoft.com/wiki/contents/articles/7681.setting-the-adfs-timeout-for-crm...