Unknown column 'formula' in 'where clause'