this is a bit of a wierd one.
i need to order a recordset by integer value descending, but if the value is above 999, then 1000 must be subtracted prior to the order. i'm doing this at the moment by looping through the recordset, dropping the values into an array and doing any necessary subtraction along the way. this is OK, but a little longwinded if there's a way of dragging the info out correctly from the db.
does anyone know if it's possible? i've played around with 'if' and 'case' but didn't get it right. the sql must work with access, mysql and mssql.
i need to order a recordset by integer value descending, but if the value is above 999, then 1000 must be subtracted prior to the order. i'm doing this at the moment by looping through the recordset, dropping the values into an array and doing any necessary subtraction along the way. this is OK, but a little longwinded if there's a way of dragging the info out correctly from the db.
does anyone know if it's possible? i've played around with 'if' and 'case' but didn't get it right. the sql must work with access, mysql and mssql.