Changed join column in SQL statement
Fixed join.
Merge branch 'master' into reporting