Hi,
I am trying to multiple update records in Table B from a single record in Table A. To identify the records that need to be updated I used this:
Select
Table1.cfirstnameas'Table 1 First',Table1.clastnameas'Table 1 Last',Table1.ifamilyid,CR.icontactid,CR.lLiveswithStudent,
Table2.cfirstnameas'Table 2 First',Table2.cLastNameas'Table 2 Last',Table2.ilocationidas'Table 2 Location',Table1.iLocationIDas'Table 1 Location'
fromTable1
JoinTable3 CRonTable1.istudentid=CR.istudentid
JoinTable2 onCR.icontactid=Table2.iContactID
whereCR.lLivesWithStudent=1 andTable1.ifamilyid>0 andTable1.ilocationid<>Table2.iLocationIDandTable1.lCurrent=1
I need to update the ilocationid from Table 1 to all Table 2 records related to Table 1but there is no direct relation from Table 1 to Table 2. I needed Table 3 to make the connection from Table 1 to 2
Thank you