6
I’m using Web2py (Python), query using the DAL I wonder if it’s possible to pick up the difference in days, something close to that
Example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
resultado = db(
(db.base_suporte.dt_solicitacao - db.base_suporte.dt_fechamento) >5
).select(db.base_suporte.dt_solicitacao)
for curiosity the return of this query is
SELECT base_suporte.dt_solicitacao FROM base_suporte WHERE (
(base_suporte.dt_solicitacao - base_suporte.dt_fechamento) > 5.0);
I know how to do this using commands of each base using db.executesql(), but would like a solution using the DAL mechanism so that it is possible to maintain compatibility with other banks
I’m using individual record processing as an alternative solution.
brother, check this: http://stackoverflow.com/questions/1907088/how-can-i-make-between-query-with-web2py-dal
– Samuel Diogo
Fala ae @Samueldiogo, between picks record between a date is another, this would help but I need to make the difference of two dates, X and Y and check if it is greater than 5 days
– Isvaldo Fernandes