I've inherited a query that gets rewritten each year that I'm attempting to recreate using the Dynamic Input Tool and there's an issue that I can't quite seem to resolve, any pointers would be greatly appreciated - thanks in advance.
I work in academia, courses are generally assigned an academic year based on the first day of term so we are in 2019 at the moment and the academic year start and end dates are:
Start Date 01-AUG-2020
End Date 31-JUL-2021
I have added these dates into the Text Input field and where I have a straightforward Start Date 01-AUG-2020
End Date 31-JUL-2021, the dynamic tool works fine.
However, this would be too easy so the additional date rules for the (current) academic year are:
Start date can be before 01-AUG-20 if the end date between 01-AUG-20 and 31-JUL-21
or Start date can be before 01-AUG-20 and End Date after 31-JUL-21.
In Oracle the code is written as:
WHERE
(mi.START_DATE Between '01-AUG-20' And '31-JUL-21'
OR mi.START_DATE < '01-AUG-20' AND mi.END_DATE BETWEEN '01-AUG-20' And '31-JUL-21'
OR mi.start_date < '01-AUG-20' AND mi.END_DATE > '31-JUL-21')
I've had to modify the query as Alteryx can't seem to translate "Between", so I've rewritten the code accordingly but what I find strange is that *some* of the criteria that I'd like to make dynamic, especially the dates immediately adjacent to the brackets, seems to be missing from the selection box.
Hope that makes sense, any pointers would be more than welcome.
Jon