SELECT field1 FROM table1 ORDER BY field2, field3

However I need to add something in so it also orders by a value that is returned from a calculation:

SELECT field1 FROM table1 ORDER BY field2, (if field 4=="" and field 5==1 then order these records in order), field3

So they are ordered by field2, then the calculation, then field3