Good evening tools people.
I'm trying to query a table on a string value but I want to treat it as numerical so I can select the correct range of records. At the moment it would select records where the value was greater than 960 for example, it's also selecting records where the value is 98.
Is there a way to process that value as numeric in my query? I've searched these forums and found something I thought might help which led me to the below but the compiler doesn't like it generating a type mismatch error.
Code:
long v_wfid
select ttocm999.toid, CAST(ttocm999.wfid AS INTEGER) :v_wfid
from ttocm999 for update
where ttocm999.comp between :comp.from and :comp.to and
ttocm999.codt between :codt.from and :codt.to and
:v_wfid between :wfid.from and :wfid.to
selectdo
dal.destroy.object("ttocm999")
commit.transaction()
endselect
this one compiles but then I get a runtime error
Code:
select ttocm999.toid
from ttocm999 for update
where ttocm999.comp between :comp.from and :comp.to and
ttocm999.codt between :codt.from and :codt.to and
CAST(ttocm999.wfid AS INTEGER) between :wfid.from and :wfid.to
selectdo
dal.destroy.object("ttocm999")
commit.transaction()
endselect
Any help you can give would be much appreciated.