Amit,

Does it works if you use tbl.created_on.max() inside the select(), instead 
of max_created_on?.

I mean, is it necessary to define max_created_on or just convenient for 
short.

Thanks.


On Wednesday, August 22, 2012 8:32:23 AM UTC+2, Amit wrote:
>
> Hi mcamel,
>
> Please find below the working code:
>
> from gluon.dal import Expression
>
> tbl = db.abc_tbl
> max_created_on = tbl.created_on.max()
> query = Expression(db,"date_sub(now(), interval interval_time minute) > 
> created_on")    
> rows=db(query).select(tbl.device_id,tbl.sensor_id,tbl.interval_time,max_created_on,groupby=tbl.device_id|tbl.sensor_id)
>
> Regards,
> Amit
>
>

-- 



Reply via email to