Convert Character to Number
  • JeffG
    Posts: 91
    Joined: Sat Aug 31, 2013 6:50 pm
    Location: Sydney

    Convert Character to Number

    by JeffG » Tue Nov 04, 2014 7:23 pm

    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?

    Thanks
  • JeffG
    Posts: 91
    Joined: Sat Aug 31, 2013 6:50 pm
    Location: Sydney

    by JeffG » Wed Nov 05, 2014 12:56 pm

    Fixed - I found the asVar function. thx
  • COBS Tech Support
    Posts: 678
    Joined: Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Wed Nov 05, 2014 6:41 pm

    Also to compare variables of different types, use the type conversion functions. Common ones include:

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

Who is online

Users browsing this forum: No registered users and 1 guest