Question
sort multiple columns by Date
I have this query which sorts the results by date, but for
some reason its not doing it properly.
Query:
<cfquery name="wall" datasource="wall">
SELECT *
FROM wall.wall
WHERE profileID = #URL.id# OR myID = #URL.id#
ORDER BY date DESC
</cfquery>
Table:
ID, profileID, myID, date
1 1 2 7/14/2007 1:11:00 PM
2 2 9 7/17/2007 1:12:00 PM
3 3 2 7/20/2007 9:13:00 PM
4 7 2 7/22/2007 12:14:00 PM
After i convert to list, than i output, it comes out like this: 9,7,3,1, keeping in mind that we have removed all the 2's.
It suppose to be coming like 7,3,9,1 (again removing all the 2's from the list. ). Myabe i'm missing something?
Thanks for any help!
Syed
Query:
<cfquery name="wall" datasource="wall">
SELECT *
FROM wall.wall
WHERE profileID = #URL.id# OR myID = #URL.id#
ORDER BY date DESC
</cfquery>
Table:
ID, profileID, myID, date
1 1 2 7/14/2007 1:11:00 PM
2 2 9 7/17/2007 1:12:00 PM
3 3 2 7/20/2007 9:13:00 PM
4 7 2 7/22/2007 12:14:00 PM
After i convert to list, than i output, it comes out like this: 9,7,3,1, keeping in mind that we have removed all the 2's.
It suppose to be coming like 7,3,9,1 (again removing all the 2's from the list. ). Myabe i'm missing something?
Thanks for any help!
Syed