Hi,
We have a legacy table structure with budget_amount_month1, budget_amount_month2……budget_amount_month12.
Need to select totals based on current_month number which we know based on gl_periods table.
Ex: current month number = 3.
How to we sum data for current_month, upto_current_month.
Basically.
for current month(ex:March number 3) budget_amount_month1+budget_amount_month2+budget_amount_month3
When the query runs in April : budget_amount_month1+budget_amount_month2+budget_amount_month3+budget_amount_month4.
We know the month number.
Please advise dynamic addition of the columns.. which have month number as last characters of the column name.
thanks