When you say it "doesn't work" what happens? Do you get an error message? If so what is the message? Are you not getting an error but getting unexpected results? If so what are the unexpected results? Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
Convert the "2.0" to a number with the ToNumber() function as suggested originally, then subtotal the formula field rather than the database field. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
I prefer to use VAL() instead of ToNumber(). If ToNumber hits an alpha character in any record it errors. Val() just returns a zero and keeps working. When you write the formula with Val() make sure you total on the new formula, not the original field. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
Actually Val() works a little bit differently. If you Val("1234 Main Street", the result will be the number 1,234. In short it will return the numeric value of the first X number of characters it finds, ending with first alpha character it finds. If the string starts with an alpha character it returns zero.
Having said that, Val() probably is better because at least it will never error on a string, where ToNumber() will. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.