I have read the documentation.
Specifically
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html
which states that yyyymmdd will be recognised as a date as long as it is valid and it is expecting a date.
What I'm interpreting your comment to me is that the IfNull statement somehow stops MySQL recognising it as a date, even though it is being compared to a date field.
Personally I think this is a big enough variation from the documentation that the documentation should have included a paragraph on this exception. And that also leaves two other questions.
1) What other functions change the interpretations of the types that we don't realise.
2) Can I even trust that '2018-06-10' will be correctly interpreted by all functions?
At the end of the day I simply need a format that will always be understood to be a date in MySQL, no matter what function is being utilised.
Thanks
Derek