MySqlTalk.com  

Go Back   MySqlTalk.com > MySQL > SQL syntax
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread
Old 02-07-2005, 12:52 PM   #1
krcoder
Junior Member
 
Join Date: Feb 2005
Posts: 1 krcoder is on a distinguished road
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
krcoder is offline   Fork this post Reply With Quote
Old 02-07-2005, 04:29 PM   #2
Azkaban
Senior Member
 
Join Date: Jul 2004
Posts: 167 Azkaban is on a distinguished road
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)?
Azkaban is offline   Fork this post Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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



All times are GMT -4. The time now is 01:23 PM.



Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Google
  Web http://www.mysqltalk.com
DISCLAIMERS:
1. We have no commercial interest in this site.
Banner Ads and Subscriptions will only be used to help pay for hosting and maintenance costs.
2. MySQLTalk.com is NOT affiliated with MySQL AB in any way.
3. MySQLTalk.com is NOT endorsed by MySQL AB in any way.
4. Please do not post any content that is harmful to MySQL or MySQL AB, meaning no misleading or obsolete information will be tolerated.
Well-founded constructive criticism meant to help the community is permitted.
5. This website is founded with the goal of improving the MySQL community.
We not only tolerate newbies, we encourage them.
Please do not ask newbies to "read the manual".