I have a query that needs to select data using BETWEEN start-date AND end-date, as well as an if/else statement in it. I am not sure how to write it.
Select <field> from <table> where orderdate between <start-date> and IF(end-date <>
cast('1901/01/01' as datetime) then use todays-date ELSE use end-date)
Any help with the if/else part of the above query would be greatly appreciated