laika222
3/16/2018 - 6:05 PM

EXAMPLE: TESS Pull No, Name, Sort from List

SELECT a.customer_no, b.display_name, b.sort_name
FROM T_LIST_CONTENTS a
JOIN FT_CONSTITUENT_DISPLAY_NAME() b ON a.customer_no = b.customer_no
WHERE list_no = 88299

/* Results showing customer_no  from T_LIST_CONTENTS and display_name and sort_name from FT_CONSTITUENT_DISPLAY_NAME

customer_no   display_name                                  sort_name
400           The League of the Chicago Symphony Orchestra  League of the Chicago Symphony Orchestra
1258          Earl and Sandra Rusnak Household              Rusnak/Earl
2728          Howard and Judith McCue Household             McCue/Howard
8625          Michael and Linda Simon Household             Simon/Michael
21238         Alfred McDougal and Nancy Lauter Household    McDougal/Alfred

*/

-- by itself, FT_CONSTITUENT_DISPLAY_NAME() pulls the following display name information for an account
SELECT * FROM FT_CONSTITUENT_DISPLAY_NAME() 
WHERE customer_no = 698833

/* Results showing info pulled:

customer_no display_name                            display_name_short                      display_name_tiny	sort_name cust_type
698833      Kirk McMahon and Cameren Rau Household  Kirk McMahon and Cameren Rau Household  Kirk McM	McMahon/Kirk      11

*/