Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    66

    Unanswered: group by year of date

    select year(beginningdateofprogram) as programyear from [name of programs] group by programyear

    I have a table called name of programs with a date field called beginningdateofprogram --
    How can i get a list of all years and the total number of programs for that year?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    SELECT Year(field1) As [year]
         , Count(field1) As [count]
    FROM   Table1
    GROUP
        BY Year(field1)
    George
    Home | Blog

Posting Permissions

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