Nevermind I was not using the .first()[sum] at the end :)

On Fri, Apr 4, 2014 at 3:01 PM, Tito Garrido <[email protected]> wrote:

> Hi,
>
> I am trying to sum a query that is a result of an inner join, the inner
> join returns as expected but I am not able to sum, when I put my sum inside
> of the select() it returns None.
>
> Do I need to change anything in my sum variable? I am trying:
>
> sum=db.table2.value.sum()
> query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select()
> # this works
> query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select(sum)
> # this returns None
>
> Regards,
>
> Tito
> --
>
> Linux User #387870
> .........____
> .... _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:_______
>



-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to