Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 read starting wth the latest date

Author  Topic 

les
Starting Member

3 Posts

Posted - 2009-06-04 : 10:02:31
hey guys i have a table that stores posts/messages. i want read this table starting with the message with the latest date. e.g.

the following table..

Sender Message dateTime
Mike hey thr..! 2009-06-02 16:09:50
John wssp guys... 2009-06-02 16:22:50
Marry um back...! 2009-06-03 10:09:50

.. shud be read as...

Sender Message dateTime
Marry um back..! 2009-06-03 10:09:50
John wssp guys... 2009-06-02 16:22:50
Mike hey thr..! 2009-06-02 16:09:50

basically i want to order by latest time/date.. please help..
thnx in advnce...

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-04 : 10:03:51
select * from table order by datecolumn DESC


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

les
Starting Member

3 Posts

Posted - 2009-06-04 : 10:06:26
@webfred... wil try that...
Go to Top of Page

les
Starting Member

3 Posts

Posted - 2009-06-04 : 10:11:32
@webfred.. it works.. thnx a lot..
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-04 : 10:36:54
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -