I think the point here is retrieve only the record with the same employeeid that has the max date. if so, why can't we rewrite that ugly query as (a much more performant)
SELECT EmployeeID, MAX(effdt) FROM person WHERE (effdt < now) GROUP BY EmployeeID ? it's because you need the name ? Il giorno giovedì 30 agosto 2012 08:32:21 UTC+2, Johann Spies ha scritto: > > Hallo Remco, > > > Try this: > import datetime > now = datetime.datetime.now() > query = db.person.effdt > now > data = SQLFORM.grid(query) > > Regards > Johann > > -- > Because experiencing your loyal love is better than life itself, > my lips will praise you. (Psalm 63:3) > > --

