none
Convert String to Number RRS feed

  • Question

  • I have got a database that has got numbers in it ,but they are in string format lie 3.313

    I can get them to display, but I cant get them to sum I tried

     

    =Sum(CDec(First(Fields!M1.Value, "MDesignsDataSet_RT")))  and

    =Sum(FormatNumber(First(Fields!M1.Value, "MDesignsDataSet_RT")))

     

    with no previal

     

    Is there a way to change string values and get them to sum?

     

    Davids Learning

     

    Tuesday, September 18, 2007 8:03 PM

All replies

  • Alright, I did get a value with this one but sometimes its not the right value

     

    =Sum(CDec(Fields!M1.Value))

     

    Why does it not return the right value all of the time?

    Davids Learning

    Tuesday, September 18, 2007 8:50 PM
  • >> =Sum(CDec(Fields!M1.Value))

     

    Why does it not return the right value all of the time?

    <<

     

    Well, what do the M1.Values actually look like?  And are any of them null?

     

    >L<

     

    Thursday, September 20, 2007 12:48 PM
  • Think this might be something else.

     

    Yesterday along it would sometimes return the wrong number, like way out in left field, but today, its returned the right number every time.

     

    Could this be an IDE thing?

     

    All of the strings in the column are there, there are no nulls.

     

    They are all  like 1.333, 10.221 ,etc

     

    Its an old table full of data that I am trying to give a facelift.

     

    Thanks

    Davids Learning

     

     

     

    Thursday, September 20, 2007 9:01 PM
  • I don't think it is an IDE thing.  I guess it might be an index problem or something. Or maybe the scope on your aggregation functions was incorrect but you accidentally fixed it by doing something else (such as editing a grouping) in the report <s>.

     

    >L<

     

    Friday, September 21, 2007 1:28 AM