- 17 May 2017, 21:22
#2998
Hi
I'm getting the below error in Contacts when trying to filter by Department - Can you help?
(I'm trying to filter a list of contacts by department so i can email them)
I'm getting the below error in Contacts when trying to filter by Department - Can you help?
(I'm trying to filter a list of contacts by department so i can email them)
- Query Error -- Report to System Administrator ASAP
MySQL Query Failed: Unknown column 'company_department.department' in 'where clause'
SELECT SQL_CALC_FOUND_ROWS
contact.is_hot AS isHot,
contact.contact_id AS contactID,
contact.contact_id AS exportID,
contact.date_modified AS dateModifiedSort,
contact.date_created AS dateCreatedSort,
owner_user.first_name AS ownerFirstName,
owner_user.last_name AS ownerLastName,
CONCAT(owner_user.last_name, owner_user.first_name) AS ownerSort,
DATE_FORMAT(contact.date_modified, '%m-%d-%y') AS dateModified,
company.name AS name,company.company_id as companyID,
contact.first_name AS firstName,
contact.last_name AS lastName,
company_department.company_department_id AS companyDepartmentID, company_department.name as department,
contact.title AS title,
contact.email1 AS email1,
contact.phone_work AS workPhone,
contact.phone_cell AS cellPhone,
contact.state AS state,
contact.notes AS notes
FROM
contact
LEFT JOIN company
ON contact.company_id = company.company_id
LEFT JOIN user AS owner_user
ON contact.owner = owner_user.user_id
LEFT JOIN company_department on company_department.company_department_id = contact.company_department_id LEFT JOIN saved_list_entry
ON saved_list_entry.data_item_type = 300
AND saved_list_entry.data_item_id = contact.contact_id
AND saved_list_entry.site_id = 1
WHERE
contact.site_id = 1
AND (company_department.department = 'sas' )
GROUP BY contact.contact_id
ORDER BY dateCreatedSort DESC
LIMIT 0, 100