db((condition) & (condition)).select() is the way to do it: you're doing db(condition and condition).select()
On Wednesday, April 17, 2013 8:52:09 AM UTC+2, José Manuel López wrote: > > I'm trying to make a very simple query: > > offersInRange= db(db.Offer.hotel == request.vars.hotel > anddb.Offer.valid_from_date > > = form.vars.valid_to_date and > > db.Offer.valid_from_date > <=form.vars.valid_to_date > ).select(db.Offer.ALL) > > I have test this too: > > offersInRange= db(db.Offer.hotel == request.vars.hotel_name > anddb.Offer.valid_from_date > > form.vars.valid_to_date and > > db.Offer.valid_from_date <form.vars.valid_to_date > ).select(db.Offer.ALL) > > This query must returns the Offers which are in a range and with an > specific ID. Instead that it returns me every row that match: > db.Offer.valid_from_date < form.vars.valid_to_date. Why is this > happening?. Any clues about the problem?. > > Thank you! > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

