Hello, I have a table "Meetings" in MySQL with the following structure:
id: Int (11), subject: String (40), day: String (2), month: String (2), year: String (4), active: String (2)
Save in the field day the day of the meeting, mes the corresponding number of the month of the meeting, and in year, the year that it occurs. for example: a meeting A that occurs on 04/20/2015 day = 20 month = 04 year = 2015
I would like to sort the result by proximity to the meeting, which is the one that is closest to occurring first. for this I used the following sql:
SELECT * FROM Reuniao ORDER BY ano ASC, mes ASC, dia ASC
It worked, but it also shows the meetings if they have already passed (first), but I need to show only the ones that are still going to happen. so I tried the following:
SELECT * FROM Reuniao WHERE ano >= 2015 AND mes >= 3 AND dia >= 3 ORDER BY ano ASC, mes ASC, dia ASC
supposing today was 03/03/2015 she should show all meetings that happen from now on, but presents an error, does not show meetings any meeting that happens before day 3 of any month, and month 3 of any year.
How to solve this? and also show only those that active="S"