No records in found set

In a situation where there is a found set of zero records, is it possible to get the value of a global field?

I’m using the following code to build an SQL query:
var strQuery = “select ID from companies where name like '”+ gCompanyFilter+“%'”;

this works fine provided that there are records in the found set. As soon as there are no records in the found set gCompanyFilter seems to be evaluating to “0” no matter what the contents of the global field are.

Do I need to programmatically ensure that I’m never dealing with no records in the found set? or is there a better way of tackling this issue?

thanks

Ian

Ian Jempson
Binhex Limited

ok, solved my own problem just after posting…

needed to change to
var strQuery = “select ID from companies where name like '”+ globals.gCompanyFilter+“%'”;

and that sorted it out just fine…

Ian