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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Table Query

Status
Not open for further replies.

goslincm

MIS
May 23, 2006
292
US
Good morning. I'm stuck and have looked at this too long. Here is a make table query I want to run which brings missing records from Local Unit table into my F65_year table. However, I also need to bring in the [FiscalEndMM] value for the missing records being identified. I cannot get that to come in.

SELECT [Local Unit DB-Contact Info].LocalUnitCd, [Local Unit DB-Contact Info].CountyCd, [Local Unit DB-Contact Info].LocalUnitType, [Local Unit DB-Contact Info].Name, [Enter Year] AS [Year] INTO tbl_Missing_Units
FROM [Local Unit DB-Contact Info] LEFT JOIN F65_Year ON ([Local Unit DB-Contact Info].LocalUnitType = F65_Year.localunittype) AND ([Local Unit DB-Contact Info].CountyCd = F65_Year.countycd) AND ([Local Unit DB-Contact Info].LocalUnitCd = F65_Year.localunitcd)
WHERE ((([Local Unit DB-Contact Info].LocalUnitType)="1" Or ([Local Unit DB-Contact Info].LocalUnitType)="2" Or ([Local Unit DB-Contact Info].LocalUnitType)="3") AND (([Enter Year])=[Enter Year]) AND ((F65_Year.localunitcd) Is Null) AND ((F65_Year.countycd) Is Null) AND ((F65_Year.localunittype) Is Null)) OR ((([Local Unit DB-Contact Info].LocalUnitCd)="000") AND (([Local Unit DB-Contact Info].LocalUnitType)="0") AND ((F65_Year.localunitcd) Is Null) AND ((F65_Year.countycd) Is Null) AND ((F65_Year.localunittype) Is Null));


Help....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top