SET ANSI ONTry this code
CREATE CURSOR ubtrans (ubnum C(10)) INSERT INTO ubtrans VALUES([01-10]) INSERT INTO ubtrans VALUES([01-10]) INSERT INTO ubtrans VALUES([01-101]) INSERT INTO ubtrans VALUES([01-102]) SET ANSI OFF SELECT distinct ubnum from ubtrans where between(alltrim(ubnum),'01-10','01-10') SET ANSI ON SELECT distinct ubnum from ubtrans where between(alltrim(ubnum),'01-10','01-10')