BUG-11886 When running a case scheduler event every 5 minutes... SOLVED

- The query was executed not taking into account all types "every".
- Add validation.