select *
from tbl_fspro_members a, qryFSE_Companies b
where 1 = 1
and a.email like '%#client.email#%'
and a.firstname like '%#client.first#%'
and a.lastname like '%#client.last#%'
and a.fspro_userid = '#val(client.userid)#'
and a.ownerid *= b.companyid
and a.fsl_tablecode *= b.companytype
and a.loginEnabled = 1
order by allowSuperUser desc, companyName
select *
from tbl_fspro_members a, qryFSE_Companies b
where allowSuperUser = 'Y'
and a.ownerid *= b.companyid
and a.fsl_tablecode *= b.companytype
and a.loginEnabled = 1
order by lastName, firstName, companyName
Total Records: #qcf_member.recordcount#