开发者

how to find earliest date and latest date from database

i want to perform email functionality in my app.In that in subject i have to add earliest date in database and latest date in database.so how can i get earliest date and latest date from databas开发者_开发问答e?I have database fields like EntryDate which is datetime datatype Amount LastEdited with datetime datatype.


You need to run a query to sort date..like

SELECT TaskDate FROM MyTask Order By TaskDate limit 1
SELECT TaskDate FROM MyTask Order By TaskDate Desc limit 1

First one will give u oldest date and second will give the latest date. hope this will help u out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜