|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a sales table
date total 2004-1-3 123,000 2004-2-2 232,000 2004-4-1 142,000 ... I need a report has sum of total sale on every month even there is on sale record on that month(show as zero) e.g. date total 2004-1 123,000 2004-2 232,000 2004-3 0 2004-4 142,000 .... is this possible??? thanks |
|
#2
|
||||
|
||||
|
you need to do a LEFT OUTER JOIN from some table to your data table
the "some table" could be an integers table see this article -- Selecting all months even if they're missing (registration may be required, but it's free) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Sum On Every Month |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|