Here is is broken down into pieces:
a=db.llamados
b=db.accountcode.with_alias('b')
c=db.clientes.with_alias('c')
query = (b.id_clientes==clte)&(a.dialstatus=='ANSWER')&
(a.inicio>=desde)&(a.inicio<=hasta)
left = (b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
rows = db(query).select
(a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inicio)
On Aug 11, 4:54 pm, FERNANDO VILLARROEL <[email protected]> wrote:
> Dear all.
>
> How i can doing the following query for web2py:
>
> select
> a.destino,a.answeredtime,a.inicio,a.fin,a.valor from llamados as a
> join
> accountcode as b on a.id_accountcode=b.id
> join
> clientes as c on b.id_clientes=c.id
>
> where id_clientes = clte and a.dialstatus='ANSWER' and (a.inicio >=
>
> desde and a.inicio <= hasta) order by a.inicio DESC
>
> I want not use executesql.
>
> Fernando
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---