2 Replies Latest reply: Jun 2, 2016 10:08 AM by J Schloesser RSS

    Two tables into 1 field (which is in a different table)?

    J Schloesser

      Hello!

       

      Can someone help me figuring our the following? I'm trying to combine 3 tables into one:

      Table 1 [forms] Contains:

           - LeadId

           - ContactId

      Table 2 [contacts] Contains:

           - ContactId

           - Name

      Table 3 [leads] Contains:

           - LeadId

           - Name

       

      I want the field 'Name' of table 2 and table 3 to be put into table 1 based on the lead/ContactId where ContactId is more important then LeadId (so if both LeadId and ContactId contain data, the name of the table Contact is taken). So what I finally want:

       

      Table [forms]

           - LeadId

           - ContactId

           - Name

       

      I have tried to achieve this with left join but this only joins one of the 2 into the field Name, if I rename one of the two to Name1 both are displayed.

       

      Thanks in advance