sql for form continuity check 1