1. Export
from MySQL any existing Annual Data records tagged as 2018 Baseline that
has data in the Financial Details table (these are probably our
customers).
SELECT MunLevel, m_schoolannualdata.* FROM m_schoolannualdata
JOIN m_municipalities ON MunID = SadScdID WHERE SadID IN (SELECT SadID FROM
m_municipalities JOIN m_schoolannualdata ON MunID = SadScdID JOIN
s_financialdatadetail ON SadID = SfdSadID WHERE MunModID = 2 AND MunState = 'MI'
AND SadYear = 2018 AND SadScenario = 'Baseline' AND SfdAmount > 0 GROUP BY
SadID)
2. In the exported file, move the values in SadID to SadScdIDold. This will allow the data in the Financial Data Detail table to be moved from the old SadID to the new SadID. Change the SadScenario field to “D” and the SadHide field to “Yes”. Change the SadDateAdded and the SadDateModified fields to Today.
3. Import the updated MS Excel fiel back into the m_schoolannualdata MySQL table.
4. Update
the SfdSadID in the Financial Data Detail table from the existing records to the
new imported SadID.
UPDATE s_financialdatadetail JOIN m_schoolannualdata ON
SfdSadID = SadScdIDold SET SfdSadID = SadID WHERE SadScdIDold <> 0 AND
SadDateAdded = '2016-03-01'
This method effectively copies all the data in
the orginal Annual Data record into the new file Scenario D (like dashboard
data).