Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    5

    Unanswered: How to make months appear in calender order

    How to make months appear in calender order

    SELECT TYear,TQuarter,TMonth,AVG(ChangeClose) AS AverageSorted
    FROM NDX
    GROUP BY TYear,TQuarter,TMonth
    ORDER BY AverageSorted DESC;

    How to write a query to display a single field with the date in the form of day/month/year?
    Last edited by nuggect; 09-06-09 at 18:49.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what do you think
    Code:
    WHERE avgsort <0
    means?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2009
    Posts
    5
    I mean avgsort >0

  4. #4
    Join Date
    Sep 2009
    Posts
    5
    all that print is the field TYear and avgsort

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT TYear
         , AVG(ChangeClose) AS avgsort
      FROM NDX
    GROUP 
        BY TYear
    HAVING avgsort > 0
    ORDER 
        BY avgsort DESC
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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