Sugar Version 5d --- Zucker 1.8
I created a customer field in LEADS called golds_member_c. I see that it also created a table called LEADS_CSTM
I am trying to pull that field in my report but keep getting MYSQL errors.
My code: WITHOUT changes.
************************************************** ************************************************** *****************************
SELECT
if (parent_type = 'leads', concat(leads.first_name, ' ', leads.last_name), ' ') as 'Lead Name',
if (parent_type = 'accounts', `accounts`.name, concat(contacts.first_name, ' ', contacts.last_name)) as 'Account/Contact Name',
notes.date_entered AS 'Date Entered', notes.date_modified AS 'Date Modified', notes.name AS 'Subject', notes.description AS 'Notes'
FROM notes
LEFT JOIN accounts on notes.parent_id = accounts.id
LEFT JOIN contacts on `notes`.`parent_id` = contacts.id
LEFT JOIN leads on `notes`.`parent_id` = leads.id
WHERE notes.deleted = 0
AND notes.created_by = '$SUGAR_USER_ID'
AND (notes.date_entered > '$StartDate' OR notes.date_modified > '$StartDate')
ORDER BY notes.date_entered
************************************************** ************************************************** *****************************
I have tried to LEFT JOIN LEADS and LEADS_CSTM, pull the field without joining, I have tried everything but what works.
Since this field is already attached to LEADS I thought it would pull without joining.
HELP!!!!!!!! What code should I use to simply get the GOLDS_MEMBER_C field to show in the report.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks