#73 adding a case.


Every time I try to add a case to a company I get this message

Unable to execute your query. Please correct this error.
Unknown column 'ca.division_id' in 'on clause'
I tried to execute:
select ca.*, c.company_id, c.company_name, c.company_code, d.division_name, cont.first_names, cont.last_name, cont.work_phone, cont.email, cas.case_status_display_html, cap.case_priority_display_html, cat.case_type_display_html, u1.username as entered_by_username, u2.username as last_modified_by_username, u3.username as case_owner_username, u4.username as account_owner_username, as1.account_status_display_html, r.rating_display_html, crm_status_display_html from cases ca, case_statuses cas, case_priorities cap, case_types cat, companies c, contacts cont, users u1, users u2, users u3, users u4, account_statuses as1, ratings r, crm_statuses crm left outer join company_division d on ca.division_id=d.division_id where ca.company_id = c.company_id and ca.case_status_id = cas.case_status_id and ca.case_priority_id = cap.case_priority_id and ca.case_type_id = cat.case_type_id and ca.contact_id = cont.contact_id and ca.entered_by = u1.user_id and ca.last_modified_by = u2.user_id and ca.user_id = u3.user_id and c.user_id = u4.user_id and c.account_status_id = as1.account_status_id and c.rating_id = r.rating_id and c.crm_status_id = crm.crm_status_id and case_id = 6
Unable to execute your query. Please correct this error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND contact_record_status = 'a' ORDER BY last_name' at line 1
I tried to execute:
SELECT CONCAT(first_names,' ',last_name), contact_id, address_id FROM contacts WHERE company_id = AND contact_record_status = 'a' ORDER BY last_name

Any idea anyone?