DROP VIEW LD0V0H10
;
CREATE VIEW LD0V0H10 AS
SELECT * 
      FROM LD0P0H10 URVAL
      WHERE EXISTS (SELECT 'X'
            FROM LD0V0AJD AJD
            WHERE AJD.VYNAMN='SAMTYCKE'
            AND URVAL.ORGID = AJD.JFRDTA3
            AND URVAL.ORGENHNR LIKE AJD.JFRDTA10
            AND URVAL.SAMTAVSER >= AJD.JFRDTA1
            AND URVAL.SAMTAVSER <= AJD.JFRDTA2)          
WITH CHECK OPTION
; 