MySQL Steps

Import the prepared Excel file into aa_UpperStClair_####

Updated the imported Fund Code: UPDATE aa_upperstclair2015 JOIN c_lufundcodes ON LfcCode = ImpFundCode JOIN c_fundtypestatecodes ON FtsID = LfcFtsID SET ImpFtsID = FtsID, ImpFutID = FtsFutID WHERE LfcMunID = ImpMunID

Check for missing FtsID’s and FutID’s: SELECT * FROM aa_upperstclair2015 ORDER BY ImpFtsID

Updated the SscID: UPDATE aa_upperstclair2015 JOIN c_lucostcenters ON LccCode = ImpFunctionCode JOIN m_finsubcategories ON SscID = LccSscID JOIN m_fincategories ON SucID = SscSucID SET ImpSscID = LccSscID WHERE ImpMunID = LccMunID AND LccSection = SucSection

Check for missing SscID’s: SELECT * FROM aa_upperstclair2015 WHERE ImpSscID IS NULL

Convert Revenue amounts to positive numbers: UPDATE aa_upperstclair2015 SET ImpAmount = (Balance * -1) WHERE ImpSection = 'Revenues'

UPDATE aa_upperstclair2015 SET ImpAmount = (Balance * -1) WHERE ImpSection = 'SOP'

UPDATE aa_upperstclair2015 SET ImpAmount = Balance WHERE ImpSection = 'Expense'

Append the records to the m_financialdetail table: INSERT INTO m_financialdatadetail (FddAndID, FddFutID, FddFtsID, FddSscID, FddAccountString, FddAmount, FddComment, FddDateAdded, FddDateModified, FddAddedBy, FddModifiedBy) SELECT ImpAndID, ImpFutID, ImpFtsID, ImpSscID, ImpAccountString, ImpAmount, ImpDescription, NOW(), NOW(), 1, 1 FROM aa_upperstclair2015