0

Hello,

How to use date function in my sql for current date.

Table description:

jid desc cname category date(posting date)
1 kpo job ab kpo 7/3/2011
2 lpo job bc lpo 8/3/2011
3 bpo job df bpo 9/3/2011

What i want to do, when i fetch data from the table it must be according to current date.
i.e..
jid desc cname category date(posting date)
3 bpo job df bpo 9/3/2011
2 lpo job bc lpo 8/3/2011
1 kpo job ab kpo 7/3/2011

Please suggest me any idea.
Thanks

5
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by swpou
0

Is date a character or a date field? In the latter case you could use a query like

select * from mytable sort by date desc;

In the former case you have to convert the date field with an inline function.

0

mysql uses the following date format
yyyy-mm-dd

you will have problems until you format your date correctly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.