Page 1 of 1

Convert Character to Number

Posted: Tue Nov 04, 2014 7:23 pm
by JeffG
Hi, in table Stock, the field Stock_in is defined as Char.
In a report I want a rule that says

stock->stock_in > 0 - that's zero, not O.

but the rule is throwing up an error because I am comparing a Char to a Number.

How do I correctly compare the two?


Posted: Wed Nov 05, 2014 12:56 pm
by JeffG
Fixed - I found the asVar function. thx

Posted: Wed Nov 05, 2014 6:41 pm
by COBS Tech Support
Also to compare variables of different types, use the type conversion functions. Common ones include:

Val(Char) --> Numeric
Str(Numeric) --> Char