problem w/ creating view to show previous year's data...
Date: 10 Aug 2004 17:20:49 -0700
Message-ID: <4a8ddd91.0408101620.13948ded_at_posting.google.com>
hi all,
I have a view that has data from this year as well as previous years. the select statment looks something like this:
create view as select
year,
costs_mon1, costs_mon2, costs_mon3 costs_mon4,
...
...
costs_mon12,
costs_current_month
from table x
the problem is I also need a current month field in this view (the view is more complicated than the above example--we're pulling fields from multiple tables as well as a UNION to grab a couple other fields).
I have a PL/SQL script that loads data and I use a variable for current_month so when the view is created, the current month costs are put in correctly--but only for the current year. I need to have the "current_month" for previous years to always equal month 12. My UI shows data for previous years, but the data needs to be displayed as if it was the last day of that year.
I'm kind of stuck on how to go about this. do I do something in the
script or can I manipulate the view to populate the
costs_current_month to always equal the costs from month 12 in
previous years.
any ideas would be greatly appreciated.
thanks
Received on Wed Aug 11 2004 - 02:20:49 CEST