SQLTeam.com | Weblogs | Forums

Query to sort data on Year and month



Hi, I have queried 2 tables to get few columns with date column.
Can some one help me with the query to sort the records by Year and Month.


not without your table definitions and your query


I have a table with the following columns - Registered date, Posts, Comments, Cost. I created a query to group by Registered date to get the final counts. So now I have to edit the query to sort the registered date based on the year and month.


You need to post your existing query for us to help you. Without that, i can only guess that you need to add a order by clause to your query

ORDER BY [Registered date]