I have a database with 3 key fields
- start_date
- end_date
- date
start_date and end_date are for events that will span multiple dates. date is for a single day event.
How can I sort all dates by start date OR date, whichever applies. Assume there is a 4th field, multiple_day_event, which is either “yes” or “no”.
Well, it looks like
IFNULL(START_DATE,DATE)IF(MULTIPLE_DAY_EVENT='yes',START_DATE, DATE)Or case, when: