Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outer Join in SQL
Message
De
28/04/2000 13:59:32
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Outer Join in SQL
Divers
Thread ID:
00364597
Message ID:
00364597
Vues:
53
All,

I want to get my Contact information including a contact number from UCnCnMet, if any.

I am using the following code:
SELECT ;
PADR(ALLTRIM(UIndivul.cLastName) + ", " + ALLTRIM(UIndivul.cFirstName) + " " + ALLTRIM(UIndivul.cMiddleName),60) as cContact,;
UIndivul.iId AS iIndivId,;
UIndivul.cFirstName,;
UIndivul.cMiddleName,;
UIndivul.cLastName,;
UIndivul.cSSN,;
UContact.iId AS iContId,;
UContact.iLocationId,;
UContact.iIndividualId,;
UPatCont.iId AS iPatContId,;
UPatCont.iPatientId,;
UPatCont.iContactId,;
UPatCont.iRelationId,;
UPatCont.iContactOrder,;
UPatCont.lCareGiver,;
ULocatn.iId AS iLocatnId,;
ULocatn.cAddress1,;
ULocatn.cAddress2,;
ULocatn.iCityId,;
ULocatn.cState,;
ULocatn.cZIP,;
ULocatn.iCountyId,;
SRelatn.cName AS cRelation,;
UCnCnMet.cValue AS cContactValue,;
SCntMeth.cName AS cType ;
FROM ;
Impact!UContact ;
INNER JOIN Impact!UPatCont ;
ON UPatCont.iContactId = UContact.iId ;
INNER JOIN Impact!UIndivul ;
ON UIndivul.iId = UContact.iIndividualId ;
INNER JOIN Impact!ULocatn ;
ON ULocatn.iId = UContact.iLocationId ;
INNER JOIN Impact!SRelatn ;
ON SRelatn.iId = UPatCont.iRelationId ;
LEFT JOIN Impact!UCnCnMet ;
ON UCnCnMet.iContactId = UContact.iId ;
INNER JOIN Impact!SCntMeth ;
ON SCntMeth.iId = UCnCnMet.iContactMethodId ;
WHERE ;
UPatCont.iPatientId = ?vp_IPatientId AND ;
UCnCnMet.iOrder = 1 ;
into cursor rex

What am I doing wrong?

TIA

Rex
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform