Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004

    Question Unanswered: Converting Text Field to Numeric


    We are querying information from a ClearQuest database to produce a report in Crystal Reports. The field has been set as a text field because unfortunately that is the only way to caputure a decimal value (that we know of anyway) like 10.5. The field called ActualHrsComplete captures the hours that a test was worked on. Our report needs to total these hours. We used the ToNumber function to get a grand total on our report but we can no longer run the report since our users insist upon putting non-numeric values in the field like n/a, NA, none, etc. (despite the caption in the database that says "Numeric Values Only - n/a = 0"!). Is there a way I can pass the field through a script that would convert a field value that would only pull out numeric values and then we can convert with the ToNumber function?

    Any help would be appreciated. Thanks in advance.

  2. #2
    Join Date
    Aug 2003

    Verify if it's a number

    Well, occurs to me that you can verify if the field it's a valid numeric string before you use the ToNumber function. Here's a little example of what you can do (if i understand your question... ):

    if NumericText({Tabla.campo}) then

    With this modification to your formula i think you avoid the error. I hope that this works to you... Bye...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts