cursor.execute(sql_first_look) result = cursor.fetchall() date = result[0] print date.strftime("%Y-%m-%d") connection.commit() cursor.close() connection.close()