return more than all...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hinge
    New Member
    • Mar 2008
    • 2

    return more than all...

    HI
    I have a table with lots of dates, costs and categories, eg;

    Date cost cat
    01-1-2007 20 1
    02-1-2007 30 1
    05-1-2007 50 1
    08-2-2007 25 1
    15-2-2007 80 1
    18-2-2007 20 1

    Then I do a sum with group by on month and cat:

    month cat cost
    1 1 100
    2 1 125


    What I want to do is to get the sum query to return all months with in a given year even though there is no data for some of to months. so for the example above I want the query to return:

    month cat cost
    1 1 100
    2 1 125
    3 1 0
    4 1 0
    5 1 0
    6 1 0
    7 1 0
    8 1 0
    9 1 0
    10 1 0
    11 1 0
    12 1 0

    How to do that ??
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    How can we help when we cannot see the query you use. (display with appropriate code tags)

    Ronald

    Comment

    • hinge
      New Member
      • Mar 2008
      • 2

      #3
      just needed some fancy joining

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by hine
        Then I do a sum with group by on month and cat:

        month cat cost
        1 1 100
        2 1 125
        So where is the query?

        Ronald

        Comment

        Working...