R
Ray Todd Jr
I have the below SQL that obtains the names of property owners from the data
stored in tables. The SQL adds the firstname, middlename, lastname and the
suffix together into a field called Property_Owner. The question I have is
this, what if the property has two owners (most do)? How do I write the SQL
to add the second name to the property owners name? I use this SQL to create
the merge data for form letters in Word. Thanks, Ray.
SELECT taPROPERTY.PropertyID, taPROPERTY.CLT, taPROPERTY.PropertyAddress,
taPROPERTY.PropertyClass, taPROPERTY.ParcelNumber,
taPROPERTY.PropertyZipCode, taPROPERTY.CourtDataID,
taPROPERTY.TaxSaleStatusID, taCOURTDATA.TaxSaleNumber,
taCOURTDATA.CaseNumber, taCOURTDATA.CaseYear, taTAXSALESTATUS.TaxSaleStatus,
taDEFENDANTS.DefendantID, taDEFENDANTS.LastName, taDEFENDANTS.FirstName,
taDEFENDANTS.MiddleName, taDEFENDANTS.Suffix, taDEFENDANTTYPE.DefendantType,
taDEFENDANTS.Address1, taDEFENDANTS.Address2, taDEFENDANTS.City,
taDEFENDANTS.State, taDEFENDANTS.Zip, [FirstName] & " " & [MiddleName] & " "
& [LastName] & " " & [Suffix] AS Property_Owner
FROM taDEFENDANTTYPE INNER JOIN ((taTAXSALESTATUS INNER JOIN (taCOURTDATA
INNER JOIN taPROPERTY ON taCOURTDATA.CourtDataID = taPROPERTY.CourtDataID) ON
taTAXSALESTATUS.TaxSaleStatusID = taPROPERTY.TaxSaleStatusID) INNER JOIN
taDEFENDANTS ON taPROPERTY.PropertyID = taDEFENDANTS.PropertyID) ON
taDEFENDANTTYPE.DefendantTypeID = taDEFENDANTS.DefendantTypeID
WHERE (([DefendantType]="Owner"));
stored in tables. The SQL adds the firstname, middlename, lastname and the
suffix together into a field called Property_Owner. The question I have is
this, what if the property has two owners (most do)? How do I write the SQL
to add the second name to the property owners name? I use this SQL to create
the merge data for form letters in Word. Thanks, Ray.
SELECT taPROPERTY.PropertyID, taPROPERTY.CLT, taPROPERTY.PropertyAddress,
taPROPERTY.PropertyClass, taPROPERTY.ParcelNumber,
taPROPERTY.PropertyZipCode, taPROPERTY.CourtDataID,
taPROPERTY.TaxSaleStatusID, taCOURTDATA.TaxSaleNumber,
taCOURTDATA.CaseNumber, taCOURTDATA.CaseYear, taTAXSALESTATUS.TaxSaleStatus,
taDEFENDANTS.DefendantID, taDEFENDANTS.LastName, taDEFENDANTS.FirstName,
taDEFENDANTS.MiddleName, taDEFENDANTS.Suffix, taDEFENDANTTYPE.DefendantType,
taDEFENDANTS.Address1, taDEFENDANTS.Address2, taDEFENDANTS.City,
taDEFENDANTS.State, taDEFENDANTS.Zip, [FirstName] & " " & [MiddleName] & " "
& [LastName] & " " & [Suffix] AS Property_Owner
FROM taDEFENDANTTYPE INNER JOIN ((taTAXSALESTATUS INNER JOIN (taCOURTDATA
INNER JOIN taPROPERTY ON taCOURTDATA.CourtDataID = taPROPERTY.CourtDataID) ON
taTAXSALESTATUS.TaxSaleStatusID = taPROPERTY.TaxSaleStatusID) INNER JOIN
taDEFENDANTS ON taPROPERTY.PropertyID = taDEFENDANTS.PropertyID) ON
taDEFENDANTTYPE.DefendantTypeID = taDEFENDANTS.DefendantTypeID
WHERE (([DefendantType]="Owner"));