Results 1 to 2 of 2

Thread: MONTHNAME not according ASC

  1. #1
    Join Date
    May 2009
    Location
    selangor
    Posts
    4
    Rep Power
    0

    MONTHNAME not according ASC

    hi/salam..

    saya de maslh dgn order by monthname.. ye tak ikut susunan like january, february, march and....
    this is my codes:
    PHP Code:
    SELECT COUNT(visittimein) AS total year(visittimein) AS yearmonthname(visittimein) AS month FROM vms "
            ."
    GROUP BY YEAR(visittimein),MONTHNAME(visittimein
    the result is:
    HTML Code:
    Tahun 	Bulan 	Total
    2004 	June 	 1
    2009 	August 	 3
    2009 	December 1
    2009 	July 	 2
    2009 	June 	 2
    2009 	September 	1
    so,macam mane saya nk ye jd asc punye turutan..
    ade sape2 boleh bg idea untk mysql punye statement..
    TQ

  2. #2
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    just use the ORDER BY ASC/DESC lor....

    Sample - order by year and month
    PHP Code:
    SELECT COUNT(visittimein) AS total year(visittimein) AS yearmonthname(visittimein) AS month FROM vms  
    GROUP BY YEAR
    (visittimein),MONTHNAME(visittimein)  
    ORDER BY visittimein 

    Sample - order by month only
    PHP Code:
    SELECT COUNT(visittimein) AS total year(visittimein) AS yearmonthname(visittimein) AS month FROM vms  
    GROUP BY YEAR
    (visittimein),MONTHNAME(visittimein)  
    ORDER BY monthname(visittimein
    Last edited by iamfreelancer; 27-08-2009 at 01:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112