SELECT a.attributeid, a.attribute, c.categoryid, c.category FROM tbl_OPR_CustAttrbs a, tbl_OPR_CustCats c WHERE a.categoryid = c.categoryid AND c.OwnerID = AND c.FSL_TableCode = AND c.categoryid in ( ) ORDER BY c.sortrank, c.category, a.attribute Evaluate( "caller.#attributes.queryName# = qmd_selAttributes" );