Remus
Remus

Reputation: 1443

Check for Numeric Value in Crystal Reports

I need to check if a database field contains a numeric value in it. Here is some pseudo code:

if {myField} is numeric
    // do something
else
    // do something else

I'm looking for a function that will allow me to do the check '{myField} is numeric'.

To help, here are some possible values for {myField} and what the result should be:

{myField} = ''          returns false
{myField} = 'abc123'    returns false
{myField} = '123abc'    returns false
{myField} = '123'       returns true

Upvotes: 4

Views: 27885

Answers (1)

John Hartsock
John Hartsock

Reputation: 86872

Using Crystal Syntax

NumericText({field})  //Returns a Boolean

Using Basic Syntax

IsNumeric({field})  //Returns a Boolean

Upvotes: 13

Related Questions