public
Authored by avatar Alexander Herold

Entferne Einträge im PKalender ohne Antrag

sql.sql 376 bytes
Update PERSONENKALENDER 
set PKWF1 = '', PKWF2 = '' 
where 
(LEN(PKWF1) > 0 or LEN(PKWF2) > 0) and 
ISDATE(PKDATUM) = 1 and 
not exists(
    Select * from ANTRAEGE 
    where 
    ANFINR = PKFINR and 
    ANPENR = PKPENR and 
    PKDATUM between ANDATUMVON and ANDATUMBIS and 
    (ANAKTUELLEEBENE >= 0 or ANAKTUELLEEBENE = -2) and 
    ANBUCHUNGSSCHLUESSEL in (PKWF1,PKWF2)
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment