Hi Everyone,
I have some calendar code that stores the events in Month, Day, Year, start_time, and end_time columns and I want to select all dates between the current date - day and the current date + 30 days. (to show a 31 day list of events).
I have 2 dates in the query (OrderDate, EventDate), since there may be more than one event on the same day and, I want to order them ASC to get the correct order.
I have this query, which is errors with "Unknown Column 'EventDate' in 'where clause'".
SELECT CONCAT(m, '-', d, '-', y, ' ', start_time) as OrderDate,
CONCAT(m, '-', d, '-', y) as EventDate, id, start_time, end_time, title
FROM pec_mssgs
WHERE EventDate
BETWEEN (curdate() - INTERVAL 1 DAY) AND (CURDATE() + INTERVAL 1 DAY)
ORDER BY OrderDate ASC
I don't see where the issue is and I would appreciate any help and guidance.
Regards,
Don