Ajmal Posted September 7, 2009 Share Posted September 7, 2009 Hi. I have the Database table in which i set the date column also and now i want to fetch all the data order by Date.How to fetch data from database in order by Insertion Date and Time using mySql query.Thanks for your time. Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2009 Share Posted September 7, 2009 Using the ORDER BY clause. http://www.w3schools.com/sql/sql_orderby.aspYou can have multiple ordering field, so if your date and time (for some reason) were stored in different fields you could do ... ORDER BY date, time Link to comment Share on other sites More sharing options...
Ajmal Posted September 7, 2009 Author Share Posted September 7, 2009 Using the ORDER BY clause. http://www.w3schools.com/sql/sql_orderby.aspYou can have multiple ordering field, so if your date and time (for some reason) were stored in different fields you could do... ORDER BY date, time Thanks Dear.But please tell me that how to fetch only the current month records. Means Fetch only one month records. Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2009 Share Posted September 7, 2009 Use the WHERE clause. How are you storing your dates (UNIX timestamp, YYYYMMDD integer, DATETIME field)?http://www.w3schools.com/sql/sql_where.asp Link to comment Share on other sites More sharing options...
Ajmal Posted September 7, 2009 Author Share Posted September 7, 2009 I Used YYYYMMDD integer to store Date. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.