© 2018 Capita Business Services Ltd. All rights reserved.

Capita Education Software Solutions is a trading name of Capita Business Services Ltd. Our Registered office is 30 Berners Street, London, W1T 3LR and our registered number is 02299747. Further information about Capita plc can be found in our legal statement.

Attendance 24 - Sample SQL code to change attendance code dates

Please see below for exemplar SQL code to modify attendance code dates for the purposes of testing.  Please modify to suit your testing needs.

 

NOT For use in schools

 

-- retire Y, J & H
select effective_to_date, effective_from_date, *
from sims.att_code
where code in ('Y', 'J', 'H')

Update sims.att_code
SET 
effective_to_date = '2024-05-16 23:59:00'
where code in ('Y', 'J', 'H')

select effectIve_to_date, effective_from_date, *
from sims.att_code
where code in ('Y', 'J', 'H')

-- set stat_comment_start_date for B, K, Y7
select stat_comment_start_date, *
from sims.att_code
where code in ('B', 'K', 'Y7')

UPDATE sims.att_code
SET 
stat_comment_start_date = '2024-05-17 00:00:00'
where code in ('B', 'K', 'Y7')

select stat_comment_start_date, *
from sims.att_code
where code in ('B', 'K', 'Y7')

-- set effective_from date for C1, C2, J1, K, Q, Y1, Y2, Y3, Y4, Y5, Y6, Y7
select effective_from_date, *
from sims.att_code
where code in ('C1', 'C2', 'J1', 'K', 'Q', 'Y1', 'Y2', 'Y3', 'Y4', 'Y5', 'Y6', 'Y7')

UPDATE sims.att_code
SET 
effective_from_date = '2024-05-17 00:00:00'
where code in ('C1', 'C2', 'J1', 'K', 'Q', 'Y1', 'Y2', 'Y3', 'Y4', 'Y5', 'Y6', 'Y7')

select effective_from_date, *
from sims.att_code
where code in ('C1', 'C2', 'J1', 'K', 'Q', 'Y1', 'Y2', 'Y3', 'Y4', 'Y5', 'Y6', 'Y7')