Hi list I need to do is display data in a sqlform.grid where I have a
query to a db with a left join.
This is the code
a = db.llamados
b = db.accountcode.with_alias ('b')
db.clientes.with_alias c = ('c')
db.rutas.with_alias r = ('r')
db.rutaproveedor.with_alias rp = ('rp')
form.accepts if (request.vars, session):
dat = request.vars.desde
DAT1 = request.vars.hasta
dt1 = datetime.datetime (* time.strptime (dat, '% Y-% m-% d%
H:% M:% S') [0:6])
dt2 = datetime.datetime (* time.strptime (DAT1, '% Y-% m-% d%
H:% M:% S') [0:6])
left = (b.on (a.id_accountcode == b.id) rp.on (==
a.id_rutaproveedor rp.id) r.on (rp.id_rutas r.id ==))
query = (db.llamados.dialstatus == 'ANSWER') &
(db.llamados.inicio> = dt1) & (db.llamados.inicio <= dt2)
SQLFORM.grid RWS = (
query,
left = left,
)
need to show the column 'rutas.nombre' and 'accountcode.ani'