hi,
i have an application that feeds data into a table of a database - table
name is XTABLE716C6DC3.
now i need a stored procedure that takes and calculates data from that dable
anytime the table is changed and store the results in a certain format into
a new table - lets call that table XTABLEOVERVIEW
the calculations i need to be done are the following:
totals for all entries sorted by date
- sum of the column FLT_REVENUE_E48E42AD sorted by date which is stored in
column DT_STARTDATE_318FA6EE
code should look somewhat like this:
SELECT
DT_STARTDATE_318FA6EE,SUM(CONVERT(DECIMAL(10,2),FLT_REVENUE_E48E42AD)) FROM
dbo.XTABLE716C6DC3
GROUP BY DT_STARTDATE_318FA6EE
ORDER BY DT_STARTDATE_318FA6EE
GO
as we have the total now i need to split the sum up into different portfolios stated in column STR_BRANCH_BB618FB1 for the dates. one of the portfolios e.g. is RETAIL
summary: i need the stored procedure to calculate data and then write
results in another table as soon as the innitial table gets changed.
calculations i need are totals of the mentioned columns listed by date for
the whole group and then the split ups for the single portfolios.
thanks for any help offered