Re: Summing up data by quarters [message #2813] |
Wed, 14 August 2002 09:13 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You don't need periodtype in the base table, it's only purpose in the lookup table is to identify the 'Quarter' entries ('02') - that's why I hardcoded it in the query. Actually, I'm not even sure why year is in the lookup table. The values will be the same for any year. Even the '13' entry that has the year hardcoded in the description could have that year added to the description dynamically.
The to_char(..., 'q') part of the query is what is grouping the entries by quarter, not the lookup table. We are just going to the lookup table to get the description for the quarter.
|
|
|