CREATE CURSOR crsTest (Account C(20), balance N(14,2), Value1 N(14,2)) FOR asd = 1 TO 150 INSERT INTO crsTest VALUES ('01-'+TRANSFORM(asd), RAND()*1000, RAND()*100000) NEXT SET ANSI OFF ** You wil get ALL Accounts that starts with '01-10' SELECT DIST * FROM crsTest WHERE Account BETWEEN '01-10' AND '01-10' SET ANSI ON ** Get ONLY '01-10' Account SELECT DIST * FROM crsTest WHERE Account BETWEEN '01-10' AND '01-10'This is tested in VFP 9. I am not sure if VFP6 has SET ANSI command, so if not try:
CREATE CURSOR crsTest (Account C(20), balance N(14,2), Value1 N(14,2)) FOR asd = 1 TO 150 INSERT INTO crsTest VALUES ('01-'+TRANSFORM(asd), RAND()*1000, RAND()*100000) NEXT lcAccFrom = PADR('01-10',20) && 20 is the length of the Account field lcAccTo = PADR('01-10',20) && 20 is the length of the Account field SELECT DIST * FROM crsTest WHERE BETWEEN(Account,lcAccFrom, lcAccTo)