Hi,
i wrote a script, which uses datetime fields to store the info when the entry was added to the database.
However, now i am running into a problem, where i would like to sort all entries by day.
It works just fine, if i do a
SELECT * FROM table WHERE datetime LIKE "2003-03-02%";
but then i can only sort it on a daily basis.
Is there any way i can sort all the datetime fields only by the date part of the entry?
Ok,
maybe a little example:
2003-03-02 21:00:00
2003-03-02 20:00:00
2003-03-01 22:22:00
2003-03-01 22:10:00
2003-03-01 01:00:00
2003-02-10 11:20:00
and i would like to get the following output via MySQL select command:
no. | date
2 | 2003-03-02
3 | 2003-03-01
1 | 2003-02-10
...any chance to do this, or will i have to change my datetime field to date? :rolleyes:
Thanks...