pls try (not tested)myorder = db.mytable.withhold_until_date | db.mytable.esi_withhold_untildb().select(db.mytable.ALL, orderby = myorder)
Hi all,I have table with 2 fields, withhold _until_date and esi_withhold_until.Is is it possible to order by so the the greater of the 2 fields was at the top of the list.
Anthony
Hi all,
This gets the results using sql but only able to do one or the other is the controller in web2pyselect * from animalTask order by GREATEST(COALESCE(withhold_until_date,0),COALESCE(esi_withhold_until_date,0)) DESC
Anthony
Hi all,This gets the results using sql but only able to do one or the other is the controller in web2pyselect * from animalTask order by GREATEST(COALESCE(withhold_until_date,0),COALESCE(esi_withhold_until_date,0)) DESC