Hi,
I have created an SQL Server view, which amongst other things, it generates the following columns:
CASE
WHEN
...conditions...
THEN Main.[ExpenseCategory]
END [ExpenseCategories],
It generates the following view (an extract):
| ExpenseID | PropertyShareHolderID | ExpenseCategory | ExpenseCategories | | 3723 | 7 | Property Purchase | NULL | | 3723 | 1156 | Property Purchase | NULL | | 3745 | 7 | Property Purchase | NULL | | 3745 | 1156 | Property Purchase | NULL | | 3749 | 7 | Property Purchase | Property Purchase | | 3749 | 1156 | Property Purchase | NULL | | 3801 | 7 | Property Purchase | Property Purchase | | 3801 | 1156 | Property Purchase | NULL | | 3822 | 7 | Property Purchase | Property Purchase | | 3822 | 9 | Property Purchase | NULL | | 3822 | 1156 | Property Purchase | NULL | | 3823 | 7 | Property Purchase | Property Purchase | | 3823 | 1156 | Property Purchase | NULL | | 3824 | 7 | Property Purchase | Property Purchase | | 3824 | 18 | Property Purchase | NULL | | 3824 | 1156 | Property Purchase | NULL | | 3825 | 7 | Property Purchase | NULL | | 3825 | 12 | Property Purchase | NULL | | 3825 | 1156 | Property Purchase | Property Purchase | | 3837 | 7 | Building Labour & Material | Building Labour & Material | | 3837 | 1156 | Building Labour & Material | NULL | | 3851 | 7 | Building Labour & Material | Building Labour & Material | | 3851 | 1156 | Building Labour & Material | NULL | | 3873 | 7 | Building Labour & Material | Building Labour & Material | | 3873 | 1156 | Building Labour & Material | NULL |
| | | |
As you will note, the "conditions" are satisfied for only one member of the ExpenseID group where ExpenseCategories is set to ExpenseCategory and for all others in the same group it is set to NULL.
How can I set ExpenseCategories to the same value for all members of the same ExpenseID group?
Thanks for your help in advance.
Regards
Abbas
Abbas