Results 1 to 6 of 6

Thread: Group by week

  1. #1
    Join Date
    Oct 2002
    Location
    Western part of Georgia, USA
    Posts
    123

    Unanswered: Group by week

    Is there an easy way to group data by week?

  2. #2
    Join Date
    Mar 2003
    Location
    Bucharest, Romania
    Posts
    80

    Re: Group by week

    Try this (in order to consider year also, if you have data that spread across multiple years):

    group by ltrim(rtrim(str(datepart(week,[date field]))))+ltrim(rtrim(str(datepart(year,[date field]))))

    IONUT

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    group by datepart(yy, dte), datepart(ww,dte)

  4. #4
    Join Date
    Oct 2002
    Location
    Western part of Georgia, USA
    Posts
    123
    Thanks for the quick reply. One other question!

    What is the best book (for someone that is new and has a tough time understanding people who really know the subject and want to impress everyone with there wisdom by talking over newbe's head) for those who want to learn stored procedures in order to do a better job of programing?

  5. #5
    Join Date
    Mar 2003
    Location
    Bucharest, Romania
    Posts
    80
    In my opinion there are no such things as good books for learning something. There only may be books that give you an ideea, a start, fundamentals about what can be done with a tool (generally speaking). And these problems are covered in almost all books I have seen so far.

    The best way of learning something is to face it. Take one real problem at a time at try work it out. For this you may use available help (the first thing to try), internet, ask someone who faced your kind of problem before you or , yes, you may use books. But you can read books for ever, the only thing that you may acomplish is to know by heart all what's inside them. Without really trying programming something ???

  6. #6
    Join Date
    Jan 2003
    Location
    Nottinghamshire, UK
    Posts
    364

    Thumbs up Here Here !!

    Originally posted by ionut calin
    The best way of learning something is to face it. Take one real problem at a time at try work it out. For this you may use available help (the first thing to try), internet, ask someone who faced your kind of problem before you or , yes, you may use books. But you can read books for ever, the only thing that you may acomplish is to know by heart all what's inside them. Without really trying programming something ???
    I Could'nt Agree More
    "Everything should be made as simple as possible, but not simpler." - Albert Einstein
    "Everything should be made as complex as possible, so I look Cleverer." - Application Developer

Posting Permissions

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