I have to provide a sum of data for a date range, the fiscal year July 
1st 2005 through June 30th 2006.  Here is the problem, the table with 
the data to be summed has NO sensible date data.  It has an integer year 
column and a varchar text column containing the full string name of each 
month of the year.

For example:

YEAR, MONTH, LBS_AI
2005, JUNE, 123
2005, JULY, 342
2005, AUGUST, 124
....
2006, MAY, 453
2006, JUNE, 235
2006, JULY, 269

This table covers data from 1990 to present in this format.  How would 
one get a sum of "LBS_AI" for the date range July 2005 through June 
2006?  My first instinct is a combination of year and a list of months, 
would this work properly?  Any other creative solutions?  If it helps 
this is an Oracle database, 7x I believe.

I.E.
WHERE (year = 2005 AND month IN ('JULY', 'AUGUST' ... 'DECEMBER') OR 
(year = 2006 AND month IN ('JANUARY', 'FEBRUARY' ... 'JUNE')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2931
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to