Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would like to modify the SQL below to sort the count by QTR and user. Not sure how to do this... Any thoughts? Thanks...


    SELECT Count(pndata_tbl.EIRID) AS CountOfEIRID, pndata_tbl.User, pndata_tbl.ClosedDate
    FROM pndata_tbl
    GROUP BY pndata_tbl.User, pndata_tbl.ClosedDate;

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I assume that QTR means quarter. Do you want to group by quarter only or by year and quarter?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes it means quarter and I would like to sort by quarter and year. Thanks..

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try this:

    SELECT Count(pndata_tbl.EIRID) AS CountOfEIRID, pndata_tbl.User, Format([pndata_tbl].[ClosedDate],"yyyy\Qq") AS QTR
    FROM pndata_tbl
    GROUP BY pndata_tbl.User, Format([pndata_tbl].[ClosedDate],"yyyy\Qq");

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Works great Hans. Thank you so much!!!

Posting Permissions

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