
Originally Posted by
tinzauro
Good morning list.
I have been trying to create some mailing list / labels from data stored in the contacts table within sugar, but I am struggling horribly.
This is how I'd like to see the label:
<firstn_name> <last_name>
<account_name>
<primary_address_street>
<primary_address_city>, <primary_address-state> <primary_address_postalcode>
I was able to perform the following query on the accounts table, but I want to be able to be able to perform the query on the contacts table. Unfortunately, I don't know how to pull the related <account_name> data in from the accounts table.
#SELECT `leads`.`first_name` AS `FIRST`, `leads`.`last_name` AS `LAST`, `leads`.`account_name` AS `COMPANY`, `leads`.`primary_address_street` AS `STREETADDRESS`, `leads`.`primary_address_city` AS `CITY`, `leads`.`primary_address_state` AS `STATE`, `leads`.`primary_address_postalcode` AS `ZIP` FROM `prod_has_sugarcrm520`.`leads` AS `leads`;
Is my problem a matter of designing the correct sql query or am I going about this the wrong way. Thank you for any help available.
Bookmarks