Fristående Skolor
KJGVAA1BTU SELECT * FROM KJGVAA1BTU WHERE SKOLFORM = 'GY'
AND BERAKNINGSTYP = 'ERS_EXTERN'
AND ((EKL_FROMDAT = '' AND EKL_TOMDAT = '' AND EKL_INGEN_ERS = '0')
OR ('20180310' NOT BETWEEN EKL_FROMDAT AND EKL_TOMDAT AND EKL_INGEN_ERS = '1')
OR ('20190310' BETWEEN EKL_FROMDAT AND EKL_TOMDAT AND EKL_INGEN_ERS = '0'))
AND ('20190310' BETWEEN FROMDAT_ERS AND TOMDAT_ERS)
AND ((EKL_FROMDAT_ERS = '' AND EKL_TOMDAT_ERS = '' AND EKL_INGEN_ERS = '0')
OR ('20190310' NOT BETWEEN EKL_FROMDAT_ERS AND EKL_TOMDAT_ERS AND EKL_INGEN_ERS = '1')
OR ('20190310' BETWEEN EKL_FROMDAT_ERS AND EKL_TOMDAT_ERS AND EKL_INGEN_ERS = '0'))
AND (EKL_SKOLENHET = SKOLENHET OR (EKL_SKOLENHET IS NULL AND SKOLENHET IS NOT NULL AND PERSONNR = '' ) )
AND UTB_ANORDNARE = 'FS' AND SKOLENHET = 'ATLE'
AND (HEMKOMMUN IS NULL OR HEMKOMMUN = '' OR HEMKOMMUN = '0180')