Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! Show number As-Is

Status
Not open for further replies.

Nicolle

Programmer
Aug 14, 2001
1
US
I have a crystal report working off an Access database. I have a text field in the database where I store numbers. I store the numbers in the text field in order to keep their correct format and number of decimal places, which all can be different. The data can also sometimes be a string. i.e.: .002340, .008, "N/A", .01.

My problem is this: How can I perform an arithmatic function on this field and still show it as a string value? If the data in this field is numeric, I need to multiply it by 100 and still show all the decimal places and digits in the original value. Crystal will not let me perform multiplication on a string value. If I create a formula and
use the function ToNumber in order to multiply by 100, Crystal converts the formula field to type 'number' and I have to select a predetermined number of decimal places.

My appreciation in advance if anyone knows how I could do this. :)
Thanks,
Nicolle
 
Nicolle,

I would work around this by converting the string to a number - perform the required calculations - then turn the number back into a string.

Cheers,

paulmarr@arcom.com.au
 
There is a Crystal formula that will handle this:

if not isnumeric({TableName.TextField}) then
{TableName.TextField}
else
totext(tonumber({TableName.TextField})*100)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top