Skip to Content
author's profile photo Former Member
Former Member

Tonumber function Error

Hi Every one,

I have a column called ATV in my sql database.It is a string type.i want to apply rounding for this in report level only.For that I am trying to convert this to number using to number function.After converting if i place this formula filed in my report it is giving error like

The string is non numeric

I need to apply rounding for the field, please suggest me an approach.


The formula written for this field in database is

(SUM(c.sale)/SUM(c.transaction_count)),'-') AS ATV

Here some times transaction_count is zero

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 17, 2013 at 02:31 PM

    Hi Divya,

    You get that error because the string field might have something else other than numbers too.

    For e.g.: A string field with this value : 12345Abhilash*^%, cannot be converted to a number.

    You would need to extract the numbers from the string.

    Use this instead of tonumber():

    val({string_field})

    Hope this helps!

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.