Convert an attribute value to use in a calculation
I have an attribute on a project that stores a ceiling amount. The attributes was setup as a Text field.
In Report Designer I need a calculation that subtracts the invoice total from the ceiling attribute. I have the invoice total but I don't know how to convert the attribute to a numeric value to use in the calculation. Example: ceiling attribute - invoice (I have this number).
Try wrapping it in the CDec expression, that should be able to convert a Text value to a Decimal value. CInt can convert it to an Integer, but CDec will allow for decimals.
The customer had a dollar symbol so the conversion wouldn't work. I removed the $ and everything worked! It would be nice if we could set attributes as a value or numeric type.
You can use the Entry Mask and/or Reg. Exp. fields to do data validation (like numbers only) on an attribute:
Thanks Tim - I think in future using the Entry Mask will prevent users from adding any special characters.
I appreciate your suggestion.