![]() |
|
|
#1 |
|
Junior Member
Join Date: Feb 2005
Posts: 1
|
Date GROUP and ORDER
I am trying to format data pulled from the DB
I want to formatt the date with the current month first and the days in these months Grouped. This piece of code is pulling the current month first correct (1) SELECT * FROM newsroom ORDER BY MONTH(Post_date); When I add the GROUP BY to sort days it breaks ?? (2)SELECT * FROM newsroom ORDER BY MONTH(Post_date) GROUP BY DAY(Post_date); The results for the First (1) SQLstatment ** Note the date should be grouped to only show one of the months day Printed results: January 2005 07 13 20 October 2004 09 03 November 2004 10 11 10 12 15 26 29 30 December 2004 10 01 02 03 06 10 12 14 15 |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Re: Date GROUP and ORDER
Your syntax looks weird to me. What is the format of your data?
Have you tried to group by month and day together (or vice versa)? |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with generating rank using group by | maven9999 | SQL syntax | 3 | 11-29-2004 03:17 AM |