Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationship with existing table

Status
Not open for further replies.

goslincm

MIS
May 23, 2006
292
US
I just cannot get beyond this spot. I have an existing table which looks like:
LocalUnitTable
CountyCd
LocalUnitType
LocalUnitCd
OfficeID(PK)

I need to start now combine some existing information that is stored in 2 other tables into the mix. The two other tables with existing information look like:

PopulationTable
CountyCd*
LocalUnitType*
LocalUnitCd*
PopulationYear*
Population

TaxValueTable
CountyCd*
LocalUnitType*
LocalUnitCd*
TaxYear*
TaxValue

I do not know how to work with these existing tables to come up with a new one to combine it all.
 
As much as that was a great article, I'm still not able to join my tables correctly after reading it.
 
Something like this ?
SELECT L.CountyCd, L.LocalUnitType, L.LocalUnitCd, L.OfficeID, P.PopulationYear, P.Population, T.TaxYear, T.TaxValue
FROM (LocalUnitTable AS L
INNER JOIN PopulationTable AS P ON L.CountyCd=L.CountyCd AND L.LocalUnitType=P.LocalUnitType AND L.LocalUnitCd=P.LocalUnitCd)
INNER JOIN TaxValueTable AS T ON P.CountyCd=T.CountyCd AND P.LocalUnitType=T.LocalUnitType AND P.LocalUnitCd=T.LocalUnitCd AND P.PopulationYear=T.TaxYear


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top