put "SELECT record_id, yrmodsize FROM stockvalving WHERE stockvalving.brand='" & gbrand & "' ORDER BY yrmodsize DESC" into theSQL this sql statement works fine with mysql but with valentina it is ordered by record_id not yrmodsize any idea why this is? Thanks Rob