Skip to content
Advertisement

Tag: sql-server-2005

How to sum Accounts

I have 3 tables: DimAccounts, DimTime and FactBudget. DimAccounts example: DimTime example: FactBudget example: In FactBudget are many Accounts just with type B. I need to calculate Debit and Credit Sums where Account type is S (Sum). Columns AccountFrom and AccountTo shows B Type Accounts from where to begin summing (AccountFrom ) and where end (AccountTo). I have made solution

Remove duplicate data in ‘date-ranged’ rows

I have a table like the following. The date range is used to know for what time period the rest of the Attributes were valid, the problem i have is that there are several consecutive time ranges where the Attributes ramain the same, what I would like is to obtain the same data but without the duplicate rows. From the

Advertisement