qry = session.query(table.c.field1, table.c.field2, func.strftime('%Y-%m',
    table.c.datestamp), func.count()).filter(table.c.datestamp < datetime.
    date.today() - datetime.timedelta(60)).group_by(table.c.field1, table.c
    .field2, func.strftime('%Y-%m', table.c.datestamp)).having(func.count() > 1
    )
SQLAlchemy: How to group by two fields and filter by date