Column name becames invalid after LEFT join

Is 'application' a column in one of your tables? Maybe you are using the wrong column name in the conditions.