MySQL Steps

The new Versions:

1.  Truncate the table “aacountycensus” and import the Excel spreadsheet into this table.

2.  Use the saved queries “State Data Templates à CO Import County Census”.

3.  Update the MunID: UPDATE aacountycensus AS IMP JOIN m_municipalities AS LU ON LU.MunFIPSCode = IMP.MunFIPSCode SET IMP.MunID = LU.MunID WHERE LU.MunModID = 1 AND LU.MunType <> 'County' AND LU.MunState = 'OH'.

4.  Check for missing MunID’s: SELECT * FROM aacountycensus WHERE MunID IS NULL.

5.  Insert any missing municipalities: INSERT INTO m_municipalities (MunName, MunOfficialName, MunType, MunTypeSub, MunFiscalYearEnd, MunSynched, MunState, MunModID, MunDateAdded, MunDateModified, MunPopulation2010) SELECT LEFT(Geography,INSTR(Geography,',')-9) AS MunName, LEFT(Geography,INSTR(Geography,',')-9) AS MunOfficialName, RIGHT(LEFT(Geography,INSTR(Geography,',')-1),7) AS MunType, RIGHT(LEFT(Geography,INSTR(Geography,',')-1),7) AS MunTypeSub, 'June' AS MunFiscalYearEnd, 'false' AS MunSynched, 'WI', 1 AS MunModID, NOW(), NOW(), IMP.population2010 FROM aacountycensus AS IMP WHERE IMP.MunID IS NULL

6.  Update the Population in m_annuladata: UPDATE m_annualdata JOIN aacountycensus ON MunID = AndMunID SET AndPopulation = Population2010 WHERE AndYear = 2010

The Old Version:

Import "qryExportCountyPopulation" from the MS Access database.