Yes. print db(db.t.day<datetime.date(2007,12,4)).select(db.t.day.max()).first() [db.t.day.max()]
is the same as m=db.t.day.max() rows = db(db.t.day<datetime.date(2007,12,4)).select(m) row = rows.first() print row[m] and row[m] is a new syntax for the old row._extra[m] described in the book. On Feb 16, 3:35 am, baloan <balo...@googlemail.com> wrote: > Thanks, Massimo. Are you sure about the "[db.t.day.max()]"? > > I'll also check dal.py if I don't find it in the book. ;-) > > @Thadeus: on a Sybase ASE MAX returns one row only. See below. > > CREATE TABLE "mt_mytable" ( > id int not null, > text varchar > ) > > insert into "tempdb"."guest"."mt_mytable" (id, text) values (1, 'a') > insert into "tempdb"."guest"."mt_mytable" (id, text) values (2, 'b') > insert into "tempdb"."guest"."mt_mytable" (id, text) values (3, 'c') > insert into "tempdb"."guest"."mt_mytable" (id, text) values (3, 'd') > commit > > select MAX(id) from mt_mytable > > >> 3 > > On Feb 16, 1:03 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > print > > db(db.t.day<datetime.date(2007,12,4)).select(db.t.day.max()).first() > > [db.t.day.max()] -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.