SQL Series 1000010

Set Period Starting Point

If the target table was last run for an earlier period, Current Period values are moved across to Previous Period Values (with addition if required).  Finally all Current Period Values are set to zero.

 

SQL Identifier

Notes and Comments

SQL 1000010 - 1

Copy N1 Costs from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 1

SQL 1000010 - 2

Copy N2 Costs from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 2

SQL 1000010 - 3

Copy N3 Costs from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 3

SQL 1000010 - 4

Copy N4 Costs from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 4

SQL 1000010 - 5

Copy N99 Costs from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 5

SQL 1000010 - 6

Copy Application Values for N1, N2, N3, N4, N99 and Total from previous run in to Previous Results Column if this is a first run in the current period.

SQL 1000010 - 6

SQL 1000010 - 7

Selects Scheme Numbers by Scheme Number Range - adding entries not already in the Application Table.  200000 - 799900, 990000, 100270.

SQL 1000010 - 7

SQL 1000010 - 8

Set Current Period N1, N2, N3, N4, N99 values to zero - and clear the CostsInCurrPeriod flag as a starting setup.

SQL 1000010 - 8

SQL 1000010 - 9

Sets the Current Period value on all Records in the Application table.

SQL 1000010 - 9

SQL 1000010 - 10

Identifies Schemes where Staff Time is allocated to the current Period through Timesheet Allocations on Activities, Works Stages.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 10

SQL 1000010 - 11

Identifies Schemes where Labour is allocated to the current Period through Allocation Sheets and Works Orders / Schemes Links.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 11

SQL 1000010 - 12

Identifies Schemes where Plant is allocated to the current Period through Allocation Sheets and Works Orders / Schemes Links.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 12

SQL 1000010 - 13

Identifies Schemes where Stock Materials is allocated to the current Period through Allocation Sheets and Works Orders / Schemes Links.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 13

SQL 1000010 - 14

Identifies Schemes where PL Materials (Imported) is allocated to the current Period through held Imported Data tables - tblMaterialsInvoiced.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 14

SQL 1000010 - 15

Identifies Schemes where SubContract Costs (Imported) is allocated to the current Period through held Imported Data tables - tblSubcontractInvoiced.  CostsInCurrPeriod flag is set for these.

SQL 1000010 - 15

SQL 1000010 - 16

Sets flags to force Costs In Current Period, and the Is DCP Flag, for Schemes in the 100270 Series.

SQL 1000010 - 16

SQL 1000010 - 17

Sets all columns in the table for Costs and Application Values to Zero where Costs In Current Period have been identified.  N1, N2, N3, N4 and Other set.

SQL 1000010 - 17