views:

53

answers:

5

I want to show records from a table having a date column from sqldatabase in dates order. How should I?

+2  A: 
SELECT
    *
    FROM yourTable
    ORDER BY yourDateColumn
KM
A: 
SELECT * FROM `table_name` ORDER BY `dates_column`

optionally you can add DESC to reverse the order (newest to oldest):

SELECT * FROM `table_name` ORDER BY `dates_column` DESC
Scott Saunders
A: 

If I understand your question correctly, you want to use an ORDER BY clause on the column containing the dates.

Eric J.
+1  A: 

you can use order by

select * from my_table t order by t.date_column

where date_column is a column name in your table.

akf
A: 

The database engine should handle the proper sorting for a date or timestamp column using an ORDER BY clause. The only exception might be if your column is of type VARCHAR and holds a date of the form "mm/dd/yyyy". Then you've got a bit more work to do.

Tenner